Mercurial > servermonitor
diff ServerMonitor/Win32Helpers.cs @ 39:7645122aa7a9
Get it working under Mono
author | Brad Greco <brad@bgreco.net> |
---|---|
date | Tue, 09 Jun 2020 20:59:00 -0400 |
parents | 68d7834dc28e |
children |
line wrap: on
line diff
--- a/ServerMonitor/Win32Helpers.cs Sun Sep 15 21:01:14 2019 -0400 +++ b/ServerMonitor/Win32Helpers.cs Tue Jun 09 20:59:00 2020 -0400 @@ -22,7 +22,13 @@ } public const int HWND_BROADCAST = 0xffff; - public static readonly int WM_SHOWMONITOR = RegisterWindowMessage("WM_SHOWMONITOR"); + + #if __MonoCS__ + public static readonly int WM_SHOWMONITOR = -12345; + #else + public static readonly int WM_SHOWMONITOR = RegisterWindowMessage("WM_SHOWMONITOR"); + #endif + [DllImport("user32")] public static extern bool PostMessage(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam); [DllImport("user32")] @@ -32,7 +38,7 @@ { /// <summary> /// Stop flashing. The system restores the window to its original state. - /// </summary> + /// </summary> FLASHW_STOP = 0, /// <summary> @@ -66,6 +72,10 @@ /// <param name="form">The form to flash.</param> public static bool FlashWindowEx(Form form) { + if (Helpers.IsMono()) { + return false; + } + IntPtr hWnd = form.Handle; FLASHWINFO fInfo = new FLASHWINFO(); @@ -82,6 +92,10 @@ /// <param name="form">The form to stop flashing.</param> public static bool StopFlashWindowEx(Form form) { + if (Helpers.IsMono()) { + return false; + } + IntPtr hWnd = form.Handle; FLASHWINFO fInfo = new FLASHWINFO();