ReactOS  0.4.10-dev-2-g0fbaea8
capclock.c File Reference
#include <windows.h>
#include <string.h>
Include dependency graph for capclock.c:

Go to the source code of this file.

Functions

static INT_PTR CALLBACK DialogFunc (HWND, UINT, WPARAM, LPARAM)
 
static VOID CALLBACK TimerProc (HWND, UINT, UINT_PTR, DWORD)
 
INT WINAPI WinMain (HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR lpCmdLine, INT nCmdShow)
 
static int InitializeApp (HWND hDlg, WPARAM wParam, LPARAM lParam)
 

Variables

UINT Timer = 1
 

Function Documentation

static INT_PTR CALLBACK DialogFunc ( HWND  hwndDlg,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 38 of file capclock.c.

Referenced by WinMain().

39 {
40  switch (msg)
41  {
42  case WM_INITDIALOG:
43  InitializeApp(hwndDlg,wParam,lParam);
44  return TRUE;
45  case WM_CLOSE:
46  KillTimer (hwndDlg,Timer);
47  EndDialog(hwndDlg,0);
48  return TRUE;
49  }
50  return FALSE;
51 }
#define TRUE
Definition: types.h:120
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define FALSE
Definition: types.h:117
UINT WPARAM wParam
Definition: precomp.h:45
#define WM_CLOSE
Definition: winuser.h:1598
static int InitializeApp(HWND hDlg, WPARAM wParam, LPARAM lParam)
Definition: capclock.c:32
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
UINT WPARAM LPARAM lParam
Definition: precomp.h:45
UINT msg
Definition: msvc.h:92
#define WM_INITDIALOG
Definition: winuser.h:1710
static int InitializeApp ( HWND  hDlg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 32 of file capclock.c.

Referenced by DialogFunc().

33 {
34  Timer = SetTimer (hDlg,Timer,1000,TimerProc);
35  TimerProc (hDlg,0,0,0);
36  return 1;
37 }
static VOID CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
Definition: capclock.c:52
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
static VOID CALLBACK TimerProc ( HWND  hwnd,
UINT  uMsg,
UINT_PTR  idEvent,
DWORD  dwTime 
)
static

Definition at line 52 of file capclock.c.

Referenced by InitializeApp().

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);
67  SetWindowText (hwnd, text);
68 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
USHORT wMonth
Definition: rtltypes.h:1672
const WCHAR * text
Definition: package.c:1827
char CHAR
Definition: xmlstorage.h:175
USHORT wYear
Definition: rtltypes.h:1671
USHORT wMinute
Definition: rtltypes.h:1676
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:276
USHORT wSecond
Definition: rtltypes.h:1677
USHORT wDay
Definition: rtltypes.h:1674
USHORT wHour
Definition: rtltypes.h:1675
#define SetWindowText
Definition: winuser.h:5718
#define wsprintf
Definition: winuser.h:5726
INT WINAPI WinMain ( HINSTANCE  hinst,
HINSTANCE  hinstPrev,
LPSTR  lpCmdLine,
INT  nCmdShow 
)

Definition at line 17 of file capclock.c.

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 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define ZeroMemory
Definition: winbase.h:1635
HBRUSH hbrBackground
Definition: winuser.h:3118
#define COLOR_WINDOW
Definition: winuser.h:903
#define DialogBox
Definition: winuser.h:5622
int cbWndExtra
Definition: winuser.h:3114
HCURSOR hCursor
Definition: winuser.h:3117
smooth NULL
Definition: ftsmooth.c:416
#define DLGWINDOWEXTRA
Definition: winuser.h:2514
static INT_PTR CALLBACK DialogFunc(HWND, UINT, WPARAM, LPARAM)
Definition: capclock.c:38
LPCSTR lpszClassName
Definition: winuser.h:3120
#define LoadCursor
Definition: winuser.h:5673
#define DefDlgProc
Definition: ros2win.h:34
HINSTANCE hInstance
Definition: winuser.h:3115
WNDPROC lpfnWndProc
Definition: winuser.h:3112
#define IDC_ARROW
Definition: winuser.h:682
static HINSTANCE hinst
Definition: edit.c:551
#define RegisterClass
Definition: winuser.h:5697

Variable Documentation