网站首页  词典首页

请输入您要查询的函数:

 

术语 getparent
释义 GetParent
语法:
HWND GetParent( HWND hWnd
);
GetParent函数
该GetParent函数检索的句柄指定的窗口的父母或所有者。
要检索的句柄指定的祖先,使用GetAncestor函数。
参数
hWnd
[in]句柄窗口的父窗口句柄是要检索。
返回值
如果窗口是一个子窗口,返回值是一个句柄父窗口。如果窗口是顶层窗口,返回值是一个句柄所有者窗口。如果窗口是顶层无主窗口或如果函数失败,返回值为NULL。为了获得更多错误信息,调用GetLastError。例如,这将决定,当函数返回NULL,如果函数失败或窗口是一个顶层窗口。
备注
请注意,尽管它的名字,这个函数可以返回一个所有者窗口而不是父窗口。要获取父窗口,而不是与GA_PARENT标志所有人,使用GetLastError。
例如
有关示例,请参阅初始化一个对话框。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.1
参见
视窗概述,GetAncestor,SetParent
==英文原文==GetParent Function
The GetParent function retrieves a handle to the specified window's parent or owner.
To retrieve a handle to a specified ancestor, use the GetAncestor function.
Syntax
HWND GetParent( HWND hWnd
);
Parameters
hWnd
[in] Handle to the window whose parent window handle is to be retrieved.
Return Value
If the window is a child window, the return value is a handle to the parent window. If the window is a top-level window, the return value is a handle to the owner window. If the window is a top-level unowned window or if the function fails, the return value is NULL. To get extended error information, call GetLastError . For example, this would determine, when the function returns NULL, if the function failed or the window was a top-level window.
Remarks
Note that, despite its name, this function can return an owner window instead of a parent window. To obtain the parent window and not the owner, use GetLastError with the GA_PARENT flag.
Example
For an example, see Initializing a Dialog Box .
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
See Also
Windows Overview , GetAncestor , SetParent
==原始网址==http://msdn.microsoft.com/en-us/library/ms633510(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:28:03