I'm currently using the GetWindow() and GetWindowText() APIs (among others) to find the window text of the program I need to shutdown. I then use PostMessage() to send a WM_CLOSE to it and it works great.
However, the title is not consistent and therefore it makes the code a mess to search for everything the title may be. I need to know of a way to get the handle to the window knowing only the executable name, or the name of the process as it would appear in the Task Manager.
Anyone know of a method of doing this?
However, the title is not consistent and therefore it makes the code a mess to search for everything the title may be. I need to know of a way to get the handle to the window knowing only the executable name, or the name of the process as it would appear in the Task Manager.
Anyone know of a method of doing this?