Set the display position of the program window on the Windows interface;
Setwindowpos (null, 1700,200, swp_nosize | swp_nozorder );
Setwindowpos prototype
Bool setwindowpos (hwnd, hwnd hwndlnsertafter, int X, int y, int CX, int cy, unit. Flags );
Hwnd: Window handle.
Hwndlnsertafter: The Window handle located in front of the preset window in Z sequence. This parameter must be a window handle or one of the following values:
Hwnd_bottom: place the window at the bottom of the Z sequence. If the hwnd parameter identifies a top-level window, the window loses its top-level position and is placed at the bottom of other windows.
Hwnd_notopmost: place the window above all non-top-level windows (that is, after all top-level windows ). If the window is already a non-top-level window, the flag does not work.
Hwnd_top: place the window at the top of the Z sequence.
Hwnd_topmost: place the window above all non-top-level windows. The top-level position is maintained even if the window is not activated.
For details about how to use this parameter, see the description section.
X: Specify the left boundary of the new window position with the customer coordinates.
Y: Specify the top boundary of the new window position with the client coordinates.
CX: Specify the new width of the window in pixels.
Cy: Specify the new height of the window in pixels.
Uflags: indicates the window size and positioning. This parameter can be a combination of the following values:
Swp_asncwindowpos: If the calling process does not have a window, the system sends a request to the thread that owns the window. This prevents the call thread from deadlocks when other threads process their needs.
Swp_defererase: prevents wm_syncpaint messages.
Swp_drawframe: draws a border around the window (defined in the window class description ).
Swp_framechanged: Send the wm_nccalcsize message to the window, even if the window size does not change. If this flag is not specified, wm_nccalcsize is sent only when the window size is changed.
Swp_hidewindow; hide the window.
Swp_noactivate: the window is not activated. If no flag is set, the window is activated and set to the top of another highest level window or a non-highest level group (based on the hwndlnsertafter parameter ).
Swp_nocopybits: clears all content in the customer zone. If this flag is not set, the valid content of the customer area is saved and copied back to the customer area after the window size is updated and relocated.
Swp_nomove: Maintain the current position (ignore the X and Y parameters ).
Swp_noownerzorder: do not change the position of the owner window in Z sequence.
Swp_noredraw: Do not redraw the changed content. If this flag is set, no re-painting is performed. Applicable to the customer and non-customer areas (including the title bar and scroll bar) and all the parts of the parent window exposed due to window return. If this flag is set, the application must explicitly invalidate the window and redraw any part of the window and the part of the parent window that needs to be repainted.
Swp_noreposition; the same as the swp_noownerzorder flag.
Swp_nosendchanging: prevents the window from receiving wm_windowposchanging messages.
Swp_nosize: Maintain the current size (ignore the Cx and Cy parameters ).
Swp_nozorder: Maintain the current Z Order (ignore the hwndlnsertafter parameter ).
Swp_showwindow: display window.
Return Value: If the function succeeds, the return value is non-zero. If the function fails, the return value is zero. To obtain more error messages, call the getlasterror function.