GrabMouse() without a window?
-
Ok so I've written a a little app that allows users to click at one point on the screen and drag their mouse to another point and it will screenshot everything withing those 4 points. Now Current the app loads and user clicks a button that invokes this.grabMouse() etc...
I was hoping for a way to fire up the application and have it grab the mouse and hide itself right away. I've been unsuccessful due to the fact that grabMouse() seems to need an object and the main window has to be drawn and loaded etc... before grabMouse() will work.
any help, ideas etc.. would be wonderful.
thanks
-
you could make your main window of a minimal size and move iot out of the visibale area (move(-200, -200)).
-
If you're working on a Windows host imho it's better to use the WinAPI for this:
Use the GetCursorPos function for the position:
http://msdn.microsoft.com/en-us/library/ms648390.aspxAnd GetKeyState for the Click-State:
http://msdn.microsoft.com/en-us/library/ms646301(VS.85).aspx
(VK_LBUTTON => List: http://msdn.microsoft.com/en-us/library/dd375731(VS.85).aspx)Taking a screenshot is done with GetWindowDC and BitBlt
(Search it on msdn)Hope it helps you