3 * DESCRIPTION: Simple Win32 Caption Clock
4 * PROJECT : ReactOS (test applications)
5 * AUTHOR : Emanuele Aliberti
7 * LICENSE : GNU GPL v2.0
13 static BOOL CALLBACK DialogFunc(HWND,UINT,WPARAM,LPARAM);
14 static VOID CALLBACK TimerProc(HWND,UINT,UINT,DWORD);
17 INT STDCALL WinMain (HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR lpCmdLine, INT nCmdShow)
21 ZeroMemory (& wc, sizeof wc);
22 wc.lpfnWndProc = DefDlgProc;
23 wc.cbWndExtra = DLGWINDOWEXTRA;
25 wc.hCursor = LoadCursor(NULL, IDC_ARROW);
26 wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
27 wc.lpszClassName = "CapClock";
29 return DialogBox(hinst, MAKEINTRESOURCE(2), NULL, (DLGPROC) DialogFunc);
32 static int InitializeApp (HWND hDlg,WPARAM wParam, LPARAM lParam)
34 Timer = SetTimer (hDlg,Timer,1000,TimerProc);
35 TimerProc (hDlg,0,0,0);
38 static BOOL CALLBACK DialogFunc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
43 InitializeApp(hwndDlg,wParam,lParam);
46 KillTimer (hwndDlg,Timer);
52 static VOID CALLBACK TimerProc (HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)
60 "%d-%02d-%02d %02d:%02d:%02d",
67 SetWindowText (hwnd, text);