public void Refresh() { if (this._hwnd != IntPtr.Zero) { APIPainting.RedrawWindow(this._hwnd, IntPtr.Zero, IntPtr.Zero, (uint)0x85); } }
private static void SplashThreadProcedure() { bool isOK = true; MSG message; if (SplashScreen.splashWindowProcedure == null) { isOK = SplashScreen.current.RegisterWindowClass(); } if (isOK) { isOK = SplashScreen.current.CreateNativeWindow(); } if (isOK) { message = new MSG(); while (APIMessage.GetMessage(ref message, IntPtr.Zero, 0, 0)) { APIMessage.TranslateMessage(ref message); APIMessage.DispatchMessage(ref message); } SplashScreen.current._hwnd = IntPtr.Zero; if (SplashScreen.current._windowToActivate != null) { if (SplashScreen.current._handleToActivate != IntPtr.Zero) { SplashScreen.Current._windowToActivate = null; APIWindow.SetForegroundWindow(APIWindow.GetLastActivePopup(SplashScreen.current._handleToActivate)); APIPainting.RedrawWindow(SplashScreen.current._handleToActivate, IntPtr.Zero, IntPtr.Zero, (uint)0x85); SplashScreen.current._handleToActivate = IntPtr.Zero; } } } }
private int SplashWindowProcedure(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam) { PAINTSTRUCT paintStruct; IntPtr timerPtr; Graphics graphics; if (msg <= (int)WindowMessages.WM_PAINT) { switch (msg) { case (int)WindowMessages.WM_CREATE: { if (!this._transparencyKey.IsEmpty && this.IsLayeringSupported()) { APIWindow.SetLayeredWindowAttributes(hwnd, (ulong)ColorTranslator.ToWin32(this._transparencyKey), (byte)0, LayeredWindowAttributesFlags.LWA_COLORKEY); } if (this._minimumDuration <= 0) { return(APIWindow.DefWindowProc(hwnd, msg, wParam, lParam)); } this._timer = APITimer.SetTimer(hwnd, 1, this._minimumDuration, (TIMERPROC)null); return(APIWindow.DefWindowProc(hwnd, msg, wParam, lParam)); } case (int)WindowMessages.WM_DESTROY: { APIMessage.PostQuitMessage(0); return(APIWindow.DefWindowProc(hwnd, msg, wParam, lParam)); } } if (msg == (int)WindowMessages.WM_PAINT) { paintStruct = new PAINTSTRUCT(); timerPtr = APIPainting.BeginPaint(hwnd, ref paintStruct); if (timerPtr != IntPtr.Zero) { graphics = Graphics.FromHdcInternal(timerPtr); graphics.DrawImage(this._image, 0, 0, this._width, this._height); OnScreenCustomize(graphics); graphics.Dispose(); } APIPainting.EndPaint(hwnd, ref paintStruct); return(0); } return(APIWindow.DefWindowProc(hwnd, msg, wParam, lParam)); } if (msg == (int)WindowMessages.WM_ERASEBKGND) { return(1); } if (msg == (int)WindowMessages.WM_TIMER) { APITimer.KillTimer(hwnd, this._timer); this._timer = 0; this._minimumDurationComplete = true; if (this._waitingForTimer) { APIMessage.PostMessage(hwnd, (int)WindowMessages.WM_CLOSE, (uint)IntPtr.Zero, (uint)IntPtr.Zero); } return(0); } return(APIWindow.DefWindowProc(hwnd, msg, wParam, lParam)); }