用SetWindowPos 函数,这是《Programming Microsoft Windows CE .NET, Third Edition》中的说明
Editing the window structure can be useful in a number of ways. The style bits of a window can be changed after the window has been created to change its default actions and look. For example, the title bar of a window can be shown or hidden by toggling the WS_CAPTION style bit. After changing any style flag that modifies the look of the window, it's customary to force the system to redraw the nonclient area of the window with a call to SetWindowPos.
SetWindowPos is one of those functions used all the time in Windows. It allows the application to move, size, change the Z-order of, and as in this case, redraw the nonclient area of the window. Its prototype is
BOOL SetWindowPos (HWND hWnd, HWND hWndInsertAfter, int X, int Y,
int cx, int cy, UINT uFlags);
The first parameter is the handle of the window that will be changed. The hWndInsertAfter parameter optionally allows the function to set the Z-order of the window. This parameter can be either a window handle or one of four flags that position the window either at the top or the bottom of the Z-order. The flags are shown here:
HWND_BOTTOM The window underneath all windows on the desktop
HWND_TOP The window on top of all windows
HWND_TOPMOST The window to always be placed on top of other windows, even when the window is deactivated
HWND_NOTTOPMOST The window on top of all other nontopmost windows but not marked as a topmost window so that it will be covered when another window is activated
The X, Y, cx, and cy parameters optionally specify the position and size of the window. The flags parameter contains one or more flags that describe the task to accomplish. The flags are as follows:
SWP_NOMOVE Don't move the window.
SWP_NOSIZE Don't resize the window.
SWP_NOZORDER Don't set the window's Z-order.
SWP_NOACTIVATE If the Z-order is set, don't activate the window.
SWP_DRAWFRAME Redraw the nonclient area.
SWP_FRAMECHANGED Recalculate the nonclient area, and then redraw.
Two other flags, SWP_SHOWWINDOW and SWP_HIDEWINDOW, show and hide the window, but it's easier to call the ShowWindow function to show or hide a window. To use SetWindowPos to force the frame to be redrawn after the style bits are changed, the call would be