DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: When user use Multiple Monitors, how to know which monitor the caret is in?  (Read 13,242 times)

maohbao

  • Typing Assistant team
  • Participant
  • Joined in 2008
  • *
  • Posts: 22
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!
Typing Assistant team <br/>
http://www.sumitsoft.com

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
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 :)
- carpe noctem

maohbao

  • Typing Assistant team
  • Participant
  • Joined in 2008
  • *
  • Posts: 22
f0dder: Thank you very much, I will try this.
Typing Assistant team <br/>
http://www.sumitsoft.com

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Let me know what you come up with, I haven't had to make anything multi-mon aware just yet :)
- carpe noctem

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 11,205
    • Participated in NANY Challenge Fourteen Times
    • Coding Snacks
    • Writer
    • Hardware Hacker
Not really what they were talking about... they were talking about from a programming perspective...

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
That looks like spam to me... google checking seems to agree.
- carpe noctem

Josh

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 3,411
    • Gathering Badge
    • Official Forum Clown
    • Coding Snacks
    • Plugin Coding Medal
    • Volunteers/Staff
    • Military Service Badge - US Army
    • Furry Fandom Badge - Furry Fandom
    • Linux User
Post removed
Strength in Knowledge

Original address: https://www.donationcoder.com/forum/index.php?topic=15991.0