diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Winamp/SPLASH.cpp | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/Winamp/SPLASH.cpp')
-rw-r--r-- | Src/Winamp/SPLASH.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/Src/Winamp/SPLASH.cpp b/Src/Winamp/SPLASH.cpp new file mode 100644 index 00000000..da3ca50b --- /dev/null +++ b/Src/Winamp/SPLASH.cpp @@ -0,0 +1,56 @@ +/** (c) Nullsoft, Inc. C O N F I D E N T I A L + ** Filename: + ** Project: + ** Description: + ** Author: + ** Created: + **/ + +#include "Main.h" + +#define SPLASH_TIMER 34 +//#define MODAL_SPLASHSCREEN + +static INT_PTR CALLBACK splashFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +static int wait; +void splashDlg(int wait_in_ms) +{ + wait = wait_in_ms; +#ifdef MODAL_SPLASHSCREEN + DialogBox(hMainInstance, MAKEINTRESOURCE(IDD_SPLASH), NULL, splashFunc); +#else + CreateDialogW(hMainInstance, MAKEINTRESOURCE(IDD_SPLASH), NULL, splashFunc); +#endif +} + +static INT_PTR CALLBACK splashFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + RECT r; + switch (uMsg) + { + case WM_INITDIALOG: + GetWindowRect(GetDlgItem(hwndDlg, IDC_SPLASHIMG), &r); + SetWindowPos(hwndDlg, 0, 0, 0, r.right - r.left, r.bottom - r.top, SWP_NOMOVE | SWP_NOZORDER); + SetTimer(hwndDlg, SPLASH_TIMER, wait, NULL); + return 0; + case WM_KEYDOWN: +case WM_LBUTTONDOWN: case WM_RBUTTONDOWN: +#ifdef MODAL_SPLASHSCREEN + EndDialog(hwndDlg, 0); +#else + DestroyWindow(hwndDlg); +#endif + return 0; + case WM_TIMER: + if (wParam == SPLASH_TIMER) + { +#ifdef MODAL_SPLASHSCREEN + EndDialog(hwndDlg, 1); +#else + DestroyWindow(hwndDlg); +#endif + } + return 0;; + } + return 0; +} |