Jump to content

[Solved] How To Get a Graphics Object For Drawing Generally on the Screen?


Zohar
 Share

Recommended Posts

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 by Zohar
Link to comment
Share on other sites

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

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 by Zohar
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...