I'm trying to use SendMessage() to send a message to an application with a hidden window. It's kind of interesting because this app responds to a broadcast SendMessage() but I figure that's not very good form to do that. Anyway, that's how I figure it has a hidden window, otherwise it would not have responded to a SendMessage(). So I'm wondering how to get an AppID for such a application/window. I'd rather not delve into more WinAPI calls. GetAppID works for a window that's been declared and I can't/don't know how to declare a window for this app. Can I just create a bogus mainwin for this app and run with it?
When I need to get the appid I use the ps.exe routine located in the NT resource kit. It works just like it's ps unix counterpart and will give you pid's or AppId's for applications even if they have a hidden window (I am preety sure).
I realize that you would have to process the return list from sys_execute and you may not want to write more code for it. But it is a resource and it has worked for me.
I will send you a copy of ps.exe after I get to work (in an hour or so).
[This message has been edited by rick_weth (edited 12-14-2000).]
I use FindWindowExA() to get a handle to a window belonging to the specified class, "CBSysTray". Then I post a message to that handle. I was able to look at our C++ code to figure out the class of the hidden window and the parameters needed for a call to PostMessage(). SilkTest didn't like it when I tried to pass NULL to PostMessage, that's why the handles are set to 0 and "".