« November 2005 »
S M T W T F S
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
You are not logged in. Log in

Programming Tips
Monday, 14 November 2005
Window style modification at runtime
Mood:  sharp
Topic: VC++
Here is how you can change the style of any control of at runtime. Here we are modifying the style of a top level window like a 
dialog or a frame window to display a maximize button if there is not one already.

	LONG lCurStyle = GetWindowLong(this->m_hWnd, GWL_STYLE);
     	SetWindowLong(this->m_hWnd,
		GWL_STYLE,
		lCurStyle|WS_MAXIMIZEBOX, SWP_FRAMECHANGED);

The second argument in SetWindowLong and GetWindowLong gives the index of the activity that the functions has to deal with. 
Here GWL_STYLE specifies that the functions have to deal with the style index.
For further details take a look in the MSDN documentation

Posted by Nibu babu thomas at 4:24 PM
Updated: Monday, 21 November 2005 1:59 PM

View Latest Entries