3 * DESCRIPTION: Simple Win32 Caption Clock
4 * PROJECT : ReactOS (test applications)
5 * AUTHOR : Emanuele Aliberti
7 * LICENSE : GNU GPL v2.0
14 static INT_PTR CALLBACK
DialogFunc(HWND
,UINT
,WPARAM
,LPARAM
);
15 static VOID CALLBACK
TimerProc(HWND
,UINT
,UINT_PTR
,DWORD
);
18 INT WINAPI
WinMain (HINSTANCE hinst
, HINSTANCE hinstPrev
, LPSTR lpCmdLine
, INT nCmdShow
)
22 ZeroMemory (& wc
, sizeof wc
);
23 wc
.lpfnWndProc
= DefDlgProc
;
24 wc
.cbWndExtra
= DLGWINDOWEXTRA
;
26 wc
.hCursor
= LoadCursor(NULL
, (LPCTSTR
)IDC_ARROW
);
27 wc
.hbrBackground
= (HBRUSH
) (COLOR_WINDOW
+ 1);
28 wc
.lpszClassName
= "CapClock";
30 return DialogBox(hinst
, MAKEINTRESOURCE(2), NULL
, DialogFunc
);
33 static int InitializeApp (HWND hDlg
,WPARAM wParam
, LPARAM lParam
)
35 Timer
= SetTimer (hDlg
,Timer
,1000,TimerProc
);
36 TimerProc (hDlg
,0,0,0);
39 static INT_PTR CALLBACK
DialogFunc (HWND hwndDlg
, UINT msg
, WPARAM wParam
, LPARAM lParam
)
44 InitializeApp(hwndDlg
,wParam
,lParam
);
47 KillTimer (hwndDlg
,Timer
);
53 static VOID CALLBACK
TimerProc (HWND hwnd
, UINT uMsg
, UINT_PTR idEvent
, DWORD dwTime
)
61 "%d-%02d-%02d %02d:%02d:%02d",
68 SetWindowText (hwnd
, text
);