source: trunk/src/comctl32/monthcal.c@ 60

Last change on this file since 60 was 60, checked in by achimha, 26 years ago

* empty log message *

File size: 2.1 KB
Line 
1/*
2 * Month calendar control
3 *
4 * Copyright 1998, 1999 Eric Kohl
5 * Copyright 1999 Achim Hasenmueller
6 *
7 * NOTES
8 * This is just a dummy control. An author is needed! Any volunteers?
9 * I will only improve this control once in a while.
10 * Eric <ekohl@abo.rhein-zeitung.de>
11 *
12 * TODO:
13 * - All messages.
14 * - All notifications.
15 *
16 */
17
18#include "winbase.h"
19#include "commctrl.h"
20#include "monthcal.h"
21
22
23#define MONTHCAL_GetInfoPtr(hwnd) ((MONTHCAL_INFO *)GetWindowLongA (hwnd, 0))
24
25
26
27
28
29
30static LRESULT
31MONTHCAL_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
32{
33 MONTHCAL_INFO *infoPtr;
34
35 /* allocate memory for info structure */
36 infoPtr = (MONTHCAL_INFO *)COMCTL32_Alloc (sizeof(MONTHCAL_INFO));
37 SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
38
39
40 /* initialize info structure */
41
42
43
44 return 0;
45}
46
47
48static LRESULT
49MONTHCAL_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
50{
51 MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr (hwnd);
52
53
54
55
56
57
58 /* free ipaddress info data */
59 COMCTL32_Free (infoPtr);
60
61 return 0;
62}
63
64
65
66
67LRESULT WINAPI
68MONTHCAL_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
69{
70 switch (uMsg)
71 {
72
73
74 case WM_CREATE:
75 return MONTHCAL_Create (hwnd, wParam, lParam);
76
77 case WM_DESTROY:
78 return MONTHCAL_Destroy (hwnd, wParam, lParam);
79
80 default:
81// if (uMsg >= WM_USER)
82// ERR (monthcal, "unknown msg %04x wp=%08x lp=%08lx\n",
83// uMsg, wParam, lParam);
84 return DefWindowProcA (hwnd, uMsg, wParam, lParam);
85 }
86 return 0;
87}
88
89
90VOID
91MONTHCAL_Register (VOID)
92{
93 WNDCLASSA wndClass;
94
95 if (GlobalFindAtomA (MONTHCAL_CLASSA)) return;
96
97 ZeroMemory (&wndClass, sizeof(WNDCLASSA));
98 wndClass.style = CS_GLOBALCLASS;
99 wndClass.lpfnWndProc = (WNDPROC)MONTHCAL_WindowProc;
100 wndClass.cbClsExtra = 0;
101 wndClass.cbWndExtra = sizeof(MONTHCAL_INFO *);
102 wndClass.hCursor = LoadCursorA (0, IDC_ARROWA);
103 wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
104 wndClass.lpszClassName = MONTHCAL_CLASSA;
105
106 RegisterClassA (&wndClass);
107}
108
109
110VOID
111MONTHCAL_Unregister (VOID)
112{
113 if (GlobalFindAtomA (MONTHCAL_CLASSA))
114 UnregisterClassA (MONTHCAL_CLASSA, (HINSTANCE)NULL);
115}
116
Note: See TracBrowser for help on using the repository browser.