LuckyLuke,
Sorry if I keep repeating my answers, but once again this is something that you could use SetWindowsHookEx in a C++ DLL with a callback to your VB program. The messages that you are going to want to respond to are WM_CREATE, and WM_SHOWWINDOW.
Remember that alot of what you have been trying to do up here is to efficiently monitor the system while it is running. To really do that well, you need to understand how the Windows OS really works . . . almost everything that happens in windows is going to have a message posted to an Event Queue . . . so it only makes sense that the best way to monitor the entire system is by monitoring the event queues. - Jeff Marler B-)
LuckyLuke,
I had one more comment/suggestion for you . . . do you have Spy++ installed on your PC? Its an app that comes with Visual Studio and it will allow you to monitor any mesages sent to any event queue for any window . . . it is really useful when you are writing code that works with the OS event queues. If have not used it before, take a look at it. - Jeff Marler B-)
I would look at using WH_SHELL. If you get a chance, take a look at "Windows NT WIN32 API Superbible" (Publisher : The Waite Group, ISBN : 1-57169-089-1). They have a great chapter devoted just to how the event queues work and how to hook into any of them as well as all of the other WIN32 APIs . . . all of the code is in C++ though. - Jeff Marler B-)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.