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)); }