ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Coding Snacks

When user use Multiple Monitors, how to know which monitor the caret is in?

(1/2) > >>

maohbao:
Hi,

I need to show a special window near the caret position. I use API GetCaretPos() and SetWindowPos() to do this. When user use one monitor, everything is easy. But when user use multiple monitors, the special window only be shown at the first monitor.

How to settle this question? Thanks!

f0dder:
Remember that with GetCaretPos(), "The caret position is always given in the client coordinates of the window that contains the caret." (quoting MSDN)... so you might need to combine with GetForegroundWindow() and ClientToScreen().

You might also be interested in this article :)

maohbao:
f0dder: Thank you very much, I will try this.

f0dder:
Let me know what you come up with, I haven't had to make anything multi-mon aware just yet :)

wraith808:
Not really what they were talking about... they were talking about from a programming perspective...

Navigation

[0] Message Index

[#] Next page

Go to full version