Skip to main content
GameDev.net gamedev.net
🔒 Locked

Mouse Buttons

Started by Greg K Jan 6, 2003 at 8:36 PM 0 replies 300+ views
Original Post
Greg K
Greg K
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?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.