Zohar Posted August 13, 2014 Share Posted August 13, 2014 (edited) Hi If you execute this: Local $hGraphics =_GDIPlus_GraphicsCreateFromHWND($SomeWindowHandle) You will get a Graphics object that will enable you to draw on that specific Window you passed to the function. But what if you want to draw on the screen generally? Let's say you have your desktop visible, and on it 3 windows open, not maximized, and you want to draw on the screen some text, and that text might cover both the desktop, +some of the open windows.. What graphics object should you then get? And how do you get it? Thank you Edited August 13, 2014 by Zohar Link to comment Share on other sites More sharing options...
JohnOne Posted August 13, 2014 Share Posted August 13, 2014 I may be wrong but usually functions take 0 as param for desktop window, or maybe you get a handle to desktop window (Program Manager). Worth a try. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Zohar Posted August 13, 2014 Author Share Posted August 13, 2014 Hi JohnOne Thank you for this idea. Specficically, the function _GDIPlus_GraphicsCreateFromHWND() is defined like this: _GDIPlus_GraphicsCreateFromHWND($hWnd) So I cannot call it with 0 parameters. Any other CreateGraphics() function that I might try? Link to comment Share on other sites More sharing options...
JohnOne Posted August 13, 2014 Share Posted August 13, 2014 Did it give you an error? Did you try with desktop handle? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Zohar Posted August 13, 2014 Author Share Posted August 13, 2014 Did it give you an error? Yes it doesn't pass compilation (Ctrl-F5) Did you try with desktop handle? When I try with the Desktop's handle, it doesn't draw on the desktop for some reason, at all. Link to comment Share on other sites More sharing options...
JohnOne Posted August 13, 2014 Share Posted August 13, 2014 How about getting graphic object from DC $hDC = _WinAPI_GetWindowDC(0) $hGraphics = _GDIPlus_GraphicsCreateFromHDC($hDC) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Zohar Posted August 13, 2014 Author Share Posted August 13, 2014 (edited) Perfect!!! Now it draws over everything open, not just the desktop but also open windows on it! Thank you very much JohnOne Edit: BTW Is there a way I could successfully do it with _GDIPlus_GraphicsCreateFromHWND() too? When I try _GDIPlus_GraphicsCreateFromHWND(0), it draws nothing. Edited August 13, 2014 by Zohar Link to comment Share on other sites More sharing options...
JohnOne Posted August 13, 2014 Share Posted August 13, 2014 Ace. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now