Win32's FindWindow() can find a particular window with the exact title, but what about “try.bat - Notepad”?

前端 未结 3 1940
情书的邮戳
情书的邮戳 2021-01-01 07:53

Win32\'s FindWindow() can find a window having the title of \"Untitled - Notepad\", but what if I just want to find a Notepad window but don\'t know whether it

3条回答
  •  感情败类
    2021-01-01 08:46

    You almost certainly want to use the EnumWindows function; this function will call you back with a window handle, and then you can use GetWindowText to inspect the window title and find the one you want.

    Now, I have no idea how to write a callback function in Ruby, so you'll need some help there.

提交回复
热议问题