Skip to content
This repository was archived by the owner on Mar 30, 2019. It is now read-only.

Commit ea09f03

Browse files
author
AndrewSt
committed
[Desktop] fix OnMonitorChanged
1 parent ee1a4a2 commit ea09f03

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Source/SharpDX.Desktop/RenderForm.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public class RenderForm : Form
7171
private const uint PBT_APMQUERYSUSPEND = 0;
7272
private const int SC_MONITORPOWER = 0xF170;
7373
private const int SC_SCREENSAVE = 0xF140;
74+
private const int WM_DISPLAYCHANGE = 0x007E;
7475
private const int MNC_CLOSE = 1;
7576
private System.Drawing.Size cachedSize;
7677
private FormWindowState previousWindowState;
@@ -435,6 +436,9 @@ protected override void WndProc(ref Message m)
435436
}
436437
}
437438
break;
439+
case WM_DISPLAYCHANGE:
440+
OnMonitorChanged(EventArgs.Empty);
441+
break;
438442
}
439443

440444
base.WndProc(ref m);

0 commit comments

Comments
 (0)