How to capture the mouse on the Topmost window?
-
-
I want to program a window, which like windows 98 Driver installation window. When it shows, you cannot click other window, and will beep once to warning. Anybody can help me or give me a tip? What I needed maybe you have, so let's help each other.
The ClipCursor function confines the cursor to a rectangular area on the screen. If a subsequent cursor position (set by the SetCursorPos function or the mouse) lies outside the rectangle, the system automatically adjusts the position to keep the cursor inside the rectangular area. BOOL ClipCursor( CONST RECT *lpRect // pointer to structure with rectangle ); RECT r; POINT p; GetClientRect(hWnd,&r); p.x=r.left; p.y=r.top; ClientToScreen(&p); UINT w=r.right-r.left; UINT h=r.bottom-r.top; r.left=p.x; r.top=p.y; r.right=r.left+w; r.bottom=r.top+h; why am i doing this !? if you capture the mouse inside a window and you right click the title bar it gets free ! this way it doesn`t ! Make sure to make your window system modal ! because if you loose control of the locked mouse RESET helps you brother ! //ate me or hate me I am the mighty keeper of the book on knowledge . Contact me to get your copy .