I am a novice and would appreciate any help you guys can give me here. I want to write a code which will tell me with which window the user is currently interacting. The code I am using is #include
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
if(hwnd == NULL)
MessageBox(NULL, "No window is currently active!","Error!" MB_ICONEXCLAMATION | MB_OK);
If I use GetForegroundWindow, I get the handle of the IDE i.e VC++. How do I write a code which will tell me which is the window the user is currently interacting with?. The issue is something like this...anytime a user is interacting with a window, I need to get a handle to that window and then selectively capture some graphics from that window. How do i proceed in this case? . So in this case would I need to run an exe from my main code which will give me the handle to the active window? Any better idea how do I do it? Waiting for replies from the experts out there!! Thanks!!