public static void _WndProc(int msg, IntPtr wParam) { if (msg == WM_SETTINGCHANGE) { // Must stop all updates or interface will freeze during screen updates. Global.DHelper.Stop(); _ResumeTimer.Stop(); _ResumeTimer.Start(); } if (msg == DeviceDetector.WM_DEVICECHANGE) { Global.DHelper.UpdateDevicesEnabled = true; } // If message value was found then... else if (msg == _WindowMessage) { // Show currently running instance. if (wParam.ToInt32() == wParam_Restore) { OnRestore?.Invoke(null, null); } // Close currently running instance. if (wParam.ToInt32() == wParam_Close) { OnClose?.Invoke(null, null); } } }
/// <summary> /// Close and make a new window. /// </summary> public void Restore() { if (!Initialized) throw new InvalidOperationException("Window not initialized."); Close(); Make(); Show(); OnRestore?.Invoke(this, EventArgs.Empty); }
internal static void HandleRestore(bool didClearRenderTargets) { OnRestore?.Invoke(didClearRenderTargets); }