代码改变世界

Visual C++ 2011-10-21

2011-10-26 22:10  Clingingboy  阅读(701)  评论(0编辑  收藏  举报

 

熟悉熟悉api…

1.BOOL IsIconic( HWND hWnd );

The IsIconic function determines whether the specified window is minimized (iconic).

2.BOOL IsZoomed( HWND hWnd );

The IsZoomed function determines whether a window is maximized.

3.HWND GetAncestor( HWND hwnd, UINT gaFlags );

The GetAncestor function retrieves the handle to the ancestor of the specified window.

GA_PARENT
Retrieves the parent window. This does not include the owner, as it does with the GetParent function.
GA_ROOT
Retrieves the root window by walking the chain of parent windows.
GA_ROOTOWNER
Retrieves the owned root window by walking the chain of parent and owner windows returned by GetParent.

4.MoveWindow and SetWindowPos

http://apps.hi.baidu.com/share/detail/23103714

5.DeferWindowPos

该函数为特定的窗口指定一个新窗口位置,并将其输入由BeginDeferWindowPos创建的结构,以便在EndDeferWindowPos函数执行期间更新(SetWindowPos立即执行)

HDWP hdwp=::BeginDeferWindowPos(1);
::DeferWindowPos(hdwp,m_pMainWnd->GetSafeHwnd(),HWND_TOPMOST,0,0,100,100,SWP_SHOWWINDOW);
::EndDeferWindowPos(hdwp);

6.CascadeWindows

The CascadeWindows function cascades the specified child windows of the specified parent window. (层叠方式排列窗口)

CascadeWindows(NULL,MDITILE_ZORDER,NULL,NULL,NULL);

7.BringWindowToTop和SetForegroundWindow

BringWindowToTop还是搞不懂…

8.TileWindows

以平铺顺序排列窗口,与CascadeWindows一样,都是属于排列窗体

TileWindows(NULL,MDITILE_HORIZONTAL,NULL,NULL,NULL);