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