Window Functions--窗口函数

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
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值