2015.4.21 SetWindowPos Function usage

Source: Internet
Author: User

Definition: [DllImport ("User32.dll")]

public static extern bool SetWindowPos (IntPtr hWnd, int hwndlnsertafter, int X, int Y, int cx, int cy, uint Flags);

Call: Api.setwindowpos (Mainhwnd,-1, 0, 0, 0, 0, 0x001 | 0x002 | 0x040);

Parameters:

Hwndinsertafter Window Overlay Position

Hwnd_topmost = 1 "top layer" above the "normal layer" used

Hwnd_top =0 on the top floor of the "normal layer"

Hwnd_bottom =1 at the bottom of the "normal layer"

hwnd_notopmost=-2 "normal layer" on all non-"normal" layers

uflags Additional Parameters

Swp_nosize =0x0001 window size unchanged (ignoring cx,cy parameters)

Swp_nomove =0x0002 non-removable window (ignore x, y parameter)

Swp_nozorder =0x0004 does not change the stacking order (ignoring the hwndinsertafter parameter)
Swp_noredraw =0x0008 do not repaint the window

Swp_noactivate =0x0010 do not activate the window

Swp_drawframe =0x0020 window with border, send border change message

Swp_showwindow =0x0040 Display window

Swp_hidewindow =0x0080 window Hidden

Swp_nocopybits =0x0100 do not keep copies of the display cache

Swp_noownerzorder =0x0200 does not change the parent window stacking order

Swp_nosendchanging =0x0400 does not accept messages for window position changes

Note: If you want to use more than one of the above uflags parameters, simply add and assign several parameters to the uflags.

2015.4.21 SetWindowPos Function usage

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.