Hi, I'm trying to create a program which checks to see if another program is running and if it is, shut it down.
It's working as long as I keep the program in focus, but when it loses focus the loop holds I guess.
Code:
while(GetMessage(&Msg, hWnd, 0, 0) > 0)
{
static HWND hIexplore;
TranslateMessage(&Msg);
DispatchMessage(&Msg);
hIexplore = FindWindow("IEFrame", "Session control window - Microsoft Internet Explorer");
if(hIexplore != NULL)
{
SendMessage(hIexplore, WM_DESTROY, 0, 0);
SendMessage(hIexplore, WM_NCDESTROY, 0, 0);
}
}
Is there a way to make the loop run while minimized ?
Or am I doing it the wrong way ?