Original Post
I have a program with no windows that needs to find out where the mouse is and what buttons on it are pressed at all times. So far I have a mouse hook that calls this function:
extern __declspec( dllexport ) LRESULT CALLBACK MouseProc(int nCode, WPARAM wParam, LPARAM lParam )
{
MOUSEHOOKSTRUCT *mouseInfo = (MOUSEHOOKSTRUCT*)lParam;
if( (mouseInfo->pt.x == 1023 && mouseInfo->pt.y == 0) )
{
HWND topWindow = GetTopWindow(NULL);
PostMessage(topWindow, WM_CLOSE, 0, 0 );
}
return 0;
}
What I want it to do is to close the top window when you click in the top right hand corner of the screen. Right now it closes stuff without a mouse click. Does anyone know how to "globaly" get a mouse click?