开发者

Getting windows caption from process ID

I have a process ID, what I want to do is return the class. If it is the desi开发者_如何学运维red class then return the caption, how do I do that?

C Visual Studio 2008, XP SP3


Use EnumWindows with GetWindowThreadProcessID to find the HWND with the matching process ID that you're looking for.

Once you have the HWND you can use GetClassName to get the class name.

Once you have the HWND with the class you want you can use either:

  • SendMessage to send a WM_GETTEXT.
  • Or GetWindowText

Read Raymond Chen's post here on the differences.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜