Intercepting WM_ACTIVATE message for any window (detecting activation with hooks/subclassing)
Posted on 2004-08-05
i currently need to detect when a certain application's window is activated and deactivated. this is a 3rd party window, not one that is part of my vb.net project. i have read a bit about hooks and subclassing, but i have not seen a concrete example of this in vb.net. i would basically like to do what Spy++ does for message logging. i can get the window's basic attributes like hWnd just fine. i am just having problem's hooking into the messages. i have successfully written code which intercepts messages from my own forms, but when i try to use a 3rd party window, i am unsuccessful. the APIs i have been using are SetWindowLong and CallWindowProc. please advise.