请输入您要查询的百科知识:

 

词条 CenterWindow
释义

函数作用

居中窗口

函数原型

BOOL CenterWindow(

HWND hWndCenter = NULL

) throw();

参数

hWndCenter

需要居中的窗口的句柄,如果此参数为NULL(默认值),该方法将设置hWndCenter到窗口的父窗口,如果它是一个子窗口。否则,将设置hWndCenter到窗口的所有者窗口。

返回值

TRUE 如果窗口成功居中则为TRUE,否则为 FALSE。

例子

CWindow childWindow, popupWindow, overlappedWindow;

childWindow.Attach(hWndChild); //创建一个WS_CHILD style属性的窗口

childWindow.CenterWindow(); //居中窗口

popupWindow.Attach(hWndPopup); //创建一个WS_POPUP style属性的窗口

popupWindow.CenterWindow(); //居中窗口

overlappedWindow.Attach(hWndOverlapped); //创建一个WS_OVERLAPPED style属性窗口

overlappedWindow.CenterWindow(::GetDesktopWindow()); //居中窗口

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/3/1 20:17:14