Home > Mobile >  How can draw a figure on top of another application?
How can draw a figure on top of another application?

Time:12-10

enter image description here

enter image description here

I want to draw a figure on another application as above. How can I do that? I tried using a window handle in c#, so I didn't get the result I wanted.

CodePudding user response:

You could draw a transparent window on top of your target application, effectively creating an overlay. This would most likely involve quite a bit direct usage of the Win32 API. See for example enumerating windows of another application.

But it will likely be an unreliable solution since there is a whole bunch of things you need to take into account:

  • Ensure that the target application still receives all input events.
  • Ensure that your transparent window stays on top of the target application
  • Monitor the target application for any window size change, or minimizing/maximizing
  • Many more things that you will likely discover later

Note that this will likely not work for full screen applications, and while this should allow for an overlay, any data on what or where to draw things need to come from somewhere else.

  • Related