0

I have application that can control other application position. On start it get current monitors' layout and dimensions. They are used to calculate the proper position of the window on the secondary monitor with the different (not default) scaling. But when the user updates the monitors' layout application keeps using initial values.

is there any possibility to capture scaling change or monitors layout change?

htonus
  • 629
  • 1
  • 9
  • 19
  • Nobody knows? Minus in the question rating doesn't help much... – htonus Feb 20 '19 at 19:40
  • Jeez, have some patience, you just posted this question an hour ago. You need to give people time to answer. Wait a day or so before complaining. And next time, please do some research before asking questions. – Remy Lebeau Feb 20 '19 at 19:47
  • Was complaining the minuses w/o explanation only. I did a lot of research. All I found is WM_DPICHANGED and WM_DISPLAYCHANGE messages handling. But my app doesn't have active ones. And the messages triggers only if the app window experiences DPI change. but I need to find the way to capture monitor layout change event or scaling change event. – htonus Feb 21 '19 at 09:42

1 Answers1

2

You need to receive and handle the WM_DPICHANGED and WM_DISPLAYCHANGE messages.

I suggest you read MSDN's documentation about High DPI Desktop Application Development and Multiple Display Monitors for more details.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • This doesn't applicable to my app since it doesn't have active windows. All it does - controls position of the other windows by external request. `WM_DPICHANGED` and `WM_DISPLAYCHANGE` works only for windows who belongs to current application. – htonus Feb 21 '19 at 09:37
  • 2
    @htonus Create a hidden window so you can receive these messages. – David Ching Dec 16 '20 at 15:37