1 minute ago, lonewolff said:
Yes, I did do a google search, thanks
Isn't this talking about getting the window 'host' applications though?
In your example, the OP is talking about an application that is using his own DLL in it.
If I were to get the HWND of something like notepad.exe how would I go about that?
Read the reply in that thread. It outlines the method and mentions the fact that you may not be dealing with a single main window. Once you can list windows that belong to a process, figure out how to go about doing that to a different process. The first logical step here would be to substitute the current process for what ever process you need. Again, first reply.
Note that there may be more than once instance of a single executable running, so you probably need to list all processes called notepad.exe, open each one and list all windows, doing your best to figure out which one is the main window. This may be trivial for notepad.exe, but not so much for something messier, like Gimp.
Just now, lonewolff said:
Anyway, worked it out. Thanks
FindWindow(NULL, "Untitled - Notepad");
This will only give you a valid result if the user is editing an unnamed and likely unsaved document and only if there is one instance of Notepad running.