Find and activate an application's window

前端 未结 3 1764
不知归路
不知归路 2021-02-12 22:41

Assume that notepad.exe is opening and the it\'s window is inactive. I will write an application to activate it. How to make?

Update: The window title i

3条回答
  •  我在风中等你
    2021-02-12 22:54

    You'd need to PInvoke the Windows API calls such as FindWindow and or EnumWindows and GetWindowText (for the title). Ideally you might also want to use GeWindowThreadProcessId so you can tie it down to the actual process.

提交回复
热议问题