开发者

Determining the Active Window name or id

hello im using VB 2008

is it possible to get active window name or id?

for example i have active notepad window, now how i can get it's process name or process ?id(better is process id开发者_StackOverflow社区)


You need to use Pinvoke to execute some Win32 API to get all this info. Below is the sequence of Pinvoke that you need to use.

  • GetForegroundWindow (to get current active window handle - hwnd)
  • GetWindowThreadProcessId (to get the process ID and thread ID for the hwnd that you got in the above API call)
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜