Dual monitor management

S

SQACSharp

I'm doing an application similar to spy++ from microsoft.

I need to draw a rectangle exactly over the windows BORDERS (not the
'client' area of the window)

Ex:
IntPtr hdc = Win32.GetDC(IntPtr.Zero);
Graphics g = Graphics.FromHdc(hdc);
....
g.DrawRectangle(....) //this draw over anything on the main monitor


It work perfecly in a single monitor setup but with a dual monitor
it's not working at all on the second monitor.

I need to get the device context from that other device/monitor and
use it's device context (or create another one)



Question :
- I want to draw a 100x100 rectangle at the location 5,5 in that
second monitor...How this could be done??????????????
- Any idea of a Managed workaround with straight C#

I tried almost anything to get or create a device context in that
screen, playing with EnumDisplayMonitor callback and different other
things.
Look like I'm missing something somewhere in virtual desktop and
multiple screen concepts...


(btw Sorry...my question is not C# specific...but GDI forums have 2-3
posts by 6 month (please tell me if you know a better GDI forums))
 
S

SQACSharp

Hope that helps.

It help a lot :) It's a very detailed post , Thanks for you time :)
Sometime we just need some good advice like this to look for a
different approach.

I will probably create my own transparent window to do the highlight
amd stay away from drawing directly to sreen/desktop

Thanks again!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top