Window Functions--窗口函数

来源:互联网 发布:windows磁盘碎片整理 编辑:程序博客网 时间:2024/04/30 12:18

GetDesktopWindow

The GetDesktopWindow function returns a handle to the desktop window. The desktop window covers the entire screen. The desktop window is the area on top of which all icons and other windows are painted.
//该函数返回桌面窗口的句柄。桌面窗口覆盖整个屏幕。桌面窗口是一个要在其上绘制所有的图标和其他窗口的区域。

原型:
HWND GetDesktopWindow(VOID);

GetWindow

The GetWindow function retrieves a handle to a window that has the specified relationship (Z order or owner) to the specified window.
//该函数返回与指定窗口有特定关系(如Z序或所有者)的窗口句柄。
原型:
HWND GetWindow(
HWND hWnd, //原来的窗口
UINT uCmd // 关系标志具体参看MSDN
);

GetParent

The GetParent function retrieves a handle to the specified child window’s parent window.

//该函数指定子窗口的父窗口的句柄。
原型:
HWND GetParent(
HWND hWnd //子窗口句柄
);

GetWindowText

The GetWindowText function copies the text of the specified window’s title bar (if it has one) into a buffer.
//该函数复制指定窗口的标题到一个缓冲区
If the specified window is a control, the text of the control is copied.
//如果指定的窗口是个控件,则复制控件的标题
However, GetWindowText cannot retrieve the text of a control in another application.
//但是,该函数不能检索其他窗口的文本。
原型:
int GetWindowText(
HWND hWnd, // 窗口或者控件
LPTSTR lpString, // 文本读出后存到的缓冲区
int nMaxCount // 复制的最大字节数
);

IsWindowVisible

The IsWindowVisible function retrieves the visibility state of the specified window.
//该函数检索指定窗口的可见标志
原型:
BOOL IsWindowVisible(
HWND hWnd // handle to window
);
返回值:
If the specified window and its parent window have the WS_VISIBLE style, the return value is nonzero.

如果指定窗口和他的父窗口有WS_VISIBLE style,则返回值非零。

GetWindowThreadProcessId

The GetWindowThreadProcessId function retrieves the identifier of the thread that created the specified window and, optionally, the identifier of the process that created the window.
//找出某个窗口的创建者(线程或进程),返回创建者的标志符。
原型:
DWORD GetWindowThreadProcessId(
HWND hWnd, // 被查找窗口的句柄.
LPDWORD lpdwProcessId // 进程号的存放地址
);

返回值
返回线程号
注意,lpdwProcessId 是存放进程号的变量。返回值是线程号

0 0
原创粉丝点击