Is there a set of API's I can use where I can specify the name of the executable (say "C:\Program Files\MyApp.exe"), and retrieve handles to a window of that app?
Printable View
Is there a set of API's I can use where I can specify the name of the executable (say "C:\Program Files\MyApp.exe"), and retrieve handles to a window of that app?
Maybe I should better explain what I'm looking for.
The program C:\MyApp.exe is going to be running, but hidden with a icon in the systray.
I want my other program to be able to signal to the running instance of MyApp.exe that it should show itself.
Is there a way to do this when I only know the path to the file?
I know FindExecutable returns a handle to a file but I don't know if that's useful..
Try the FindExecutable API.
http://www.allapi.net/apilist/FindExecutable.shtml
Right, but what can I do with that handle that's returned?
Try this:
VB Code:
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long Private Const SW_SHOWNORMAL = 1 'usage ShowWindow HandleOfFile&, SW_SHOWNORMAL