开发者

Getting windows caption from process ID

开发者 https://www.devze.com 2022-12-20 21:33 出处:网络
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?

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

精彩评论

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

关注公众号