ReactOS 0.4.15-dev-7958-gcd0bb1a
capclock.c
Go to the documentation of this file.
1/*
2 * DESCRIPTION: Simple Win32 Caption Clock
3 * PROJECT : ReactOS (test applications)
4 * AUTHOR : Emanuele Aliberti
5 * DATE : 2003-09-03
6 * LICENSE : GNU GPL v2.0
7 */
8#include <windows.h>
9#include <string.h>
10
12
15
16
17INT WINAPI WinMain (HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR lpCmdLine, INT nCmdShow)
18{
19 WNDCLASS wc;
20
21 ZeroMemory (& wc, sizeof wc);
24 wc.hInstance = hinst;
26 wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
27 wc.lpszClassName = "CapClock";
28 RegisterClass (& wc);
30
31}
33{
34 Timer = SetTimer (hDlg,Timer,1000,TimerProc);
35 TimerProc (hDlg,0,0,0);
36 return 1;
37}
39{
40 switch (msg)
41 {
42 case WM_INITDIALOG:
44 return TRUE;
45 case WM_CLOSE:
46 KillTimer (hwndDlg,Timer);
47 EndDialog(hwndDlg,0);
48 return TRUE;
49 }
50 return FALSE;
51}
53{
54 CHAR text [20];
55 SYSTEMTIME lt;
56
57 GetLocalTime (& lt);
58 wsprintf (
59 text,
60 "%d-%02d-%02d %02d:%02d:%02d",
61 lt.wYear,
62 lt.wMonth,
63 lt.wDay,
64 lt.wHour,
65 lt.wMinute,
66 lt.wSecond);
68}
69/* EOF */
#define msg(x)
Definition: auth_time.c:54
static VOID CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
Definition: capclock.c:52
static INT_PTR CALLBACK DialogFunc(HWND, UINT, WPARAM, LPARAM)
Definition: capclock.c:38
static int InitializeApp(HWND hDlg, WPARAM wParam, LPARAM lParam)
Definition: capclock.c:32
INT WINAPI WinMain(HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR lpCmdLine, INT nCmdShow)
Definition: capclock.c:17
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CALLBACK
Definition: compat.h:35
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:286
const WCHAR * text
Definition: package.c:1799
unsigned long DWORD
Definition: ntddk_ex.h:95
static HINSTANCE hinst
Definition: edit.c:551
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
#define DefDlgProc
Definition: ros2win.h:34
DWORD dwTime
Definition: solitaire.cpp:27
WORD wYear
Definition: winbase.h:905
WORD wMonth
Definition: winbase.h:906
WORD wHour
Definition: winbase.h:909
WORD wSecond
Definition: winbase.h:911
WORD wMinute
Definition: winbase.h:910
WORD wDay
Definition: winbase.h:908
HBRUSH hbrBackground
Definition: winuser.h:3170
HINSTANCE hInstance
Definition: winuser.h:3167
HCURSOR hCursor
Definition: winuser.h:3169
int cbWndExtra
Definition: winuser.h:3166
LPCSTR lpszClassName
Definition: winuser.h:3172
WNDPROC lpfnWndProc
Definition: winuser.h:3164
int32_t INT_PTR
Definition: typedefs.h:64
int32_t INT
Definition: typedefs.h:58
#define ZeroMemory
Definition: winbase.h:1712
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define DLGWINDOWEXTRA
Definition: winuser.h:2565
#define WM_CLOSE
Definition: winuser.h:1621
#define COLOR_WINDOW
Definition: winuser.h:918
#define IDC_ARROW
Definition: winuser.h:687
#define WM_INITDIALOG
Definition: winuser.h:1739
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define LoadCursor
Definition: winuser.h:5812
#define wsprintf
Definition: winuser.h:5865
#define RegisterClass
Definition: winuser.h:5836
#define SetWindowText
Definition: winuser.h:5857
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define DialogBox
Definition: winuser.h:5761
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
char * LPSTR
Definition: xmlstorage.h:182
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
char CHAR
Definition: xmlstorage.h:175