术语 | setparent |
释义 | SetParent 语法: HWND SetParent( HWND hWndChild, HWND hWndNewParent ); SetParent函数 SetParent函数改变指定的子窗口的父窗口。 参数 hWndChild [in]句柄子窗口。 hWndNewParent [in]句柄新的父窗口。如果该参数为NULL,则桌面窗口将成为新的父窗口。视窗2000/XP的:如果该参数是HWND_MESSAGE,子窗口成为消息的唯一窗口。 返回值 如果函数成功,返回值是一个句柄到以前的父窗口。 如果函数失败,返回值为NULL。为了获得更多错误信息,调用GetLastError。 备注 应用程序可以使用SetParent函数来设置父窗口弹出行动,重叠,或子窗口。 如果被hWndChild参数标识的窗口可见,系统执行相应的重画和重新油漆。 出于兼容性原因,SetParent不会修改WS_CHILD或其母公司正在改变窗口WS_POPUP窗口样式。因此,如果hWndNewParent为NULL,您也应该清除WS_CHILD位和调用SetParent后成立的WS_POPUP风格。反过来说,如果不为NULL hWndNewParent和窗口以前桌面的孩子,您应该清除WS_POPUP风格和调用SetParent之前设置的WS_CHILD样式。 视窗2000/XP的:当您改变一个窗口的父,您应该同步进行的两个窗口UISTATE。如需信息见WM_CHANGEUISTATE和WM_UPDATEUISTATE。 功能信息 最低DLL版本 user32.dll 在Winuser.h中HeaderDeclared,头文件:winuser.h import libraryUser32.lib 最低操作系统Windows 95,Windows NT 3.1 UnicodeImplemented为Unicode版本。 参见 视窗概述,GetParent ==英文原文==SetParent Function The SetParent function changes the parent window of the specified child window. Syntax HWND SetParent( HWND hWndChild, HWND hWndNewParent ); Parameters hWndChild [in] Handle to the child window. hWndNewParent [in] Handle to the new parent window. If this parameter is NULL, the desktop window becomes the new parent window. Windows 2000/XP: If this parameter is HWND_MESSAGE, the child window becomes a message-only window . Return Value If the function succeeds, the return value is a handle to the previous parent window. If the function fails, the return value is NULL. To get extended error information, call GetLastError . Remarks An application can use the SetParent function to set the parent window of a pop-up, overlapped, or child window. If the window identified by the hWndChild parameter is visible, the system performs the appropriate redrawing and repainting. For compatibility reasons, SetParent does not modify the WS_CHILD or WS_POPUP window styles of the window whose parent is being changed. Therefore, if hWndNewParent is NULL, you should also clear the WS_CHILD bit and set the WS_POPUP style after calling SetParent. Conversely, if hWndNewParent is not NULL and the window was previously a child of the desktop, you should clear the WS_POPUP style and set the WS_CHILD style before calling SetParent. Windows 2000/XP: When you change the parent of a window, you should synchronize the UISTATE of both windows. For more information, see WM_CHANGEUISTATE and WM_UPDATEUISTATE . Function Information Minimum DLL Versionuser32.dll HeaderDeclared in Winuser.h, include Windows.h Import libraryUser32.lib Minimum operating systemsWindows 95, Windows NT 3.1 UnicodeImplemented as Unicode version. See Also Windows Overview , GetParent ==原始网址==http://msdn.microsoft.com/en-us/library/ms633541(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。