0

I'm trying to "dock" an app to the left of MS Word.

However, the .Left property of the Word window seems to be wrong - like it's scaled somehow.

When the window is close to the far left (0), the returned value for .Left is close to what I'd expect - accurate.

The further I move Word to the right, the more inaccurate it gets. If I move it to my left monitor, the same pattern happens - the further negative the more inaccurate.

I've tried retrieving the .Left value in two ways: by p/invoking to FindWindowByCaption(), and then calling GetWindowRect(), and also by using COM Interop to access the window.

Using the first technique against calculator.exe brings back the correct value, so I assume it's not got anything to do with DPI.

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
Nik
  • 2,718
  • 23
  • 34

1 Answers1

0

Did You try to get the primary screen, and translate the returned coordinates to Client like GetCLientRect ? This seems to be Your solution : How do I find position of a Win32 control/window relative to its parent window? where parent window will be 0 ( Desktop ).

Community
  • 1
  • 1
icbytes
  • 1,831
  • 1
  • 17
  • 27