2 * Month calendar control
4 * Copyright 1998 Eric Kohl
7 * This is just a dummy control. An author is needed! Any volunteers?
8 * I will only improve this control once in a while.
9 * Eric <ekohl@abo.rhein-zeitung.de>
13 * - All notifications.
23 #define MONTHCAL_GetInfoPtr(wndPtr) ((MONTHCAL_INFO *)wndPtr->wExtra[0])
31 MONTHCAL_Create (WND
*wndPtr
, WPARAM32 wParam
, LPARAM lParam
)
33 MONTHCAL_INFO
*infoPtr
;
35 /* allocate memory for info structure */
36 infoPtr
= (MONTHCAL_INFO
*)COMCTL32_Alloc (sizeof(MONTHCAL_INFO
));
37 wndPtr
->wExtra
[0] = (DWORD
)infoPtr
;
39 if (infoPtr
== NULL
) {
40 ERR (monthcal
, "could not allocate info memory!\n");
44 if ((MONTHCAL_INFO
*)wndPtr
->wExtra
[0] != infoPtr
) {
45 ERR (monthcal
, "pointer assignment error!\n");
49 /* initialize info structure */
58 MONTHCAL_Destroy (WND
*wndPtr
, WPARAM32 wParam
, LPARAM lParam
)
60 MONTHCAL_INFO
*infoPtr
= MONTHCAL_GetInfoPtr(wndPtr
);
67 /* free ipaddress info data */
68 COMCTL32_Free (infoPtr
);
77 MONTHCAL_WindowProc (HWND32 hwnd
, UINT32 uMsg
, WPARAM32 wParam
, LPARAM lParam
)
79 WND
*wndPtr
= WIN_FindWndPtr(hwnd
);
86 return MONTHCAL_Create (wndPtr
, wParam
, lParam
);
89 return MONTHCAL_Destroy (wndPtr
, wParam
, lParam
);
93 ERR (monthcal
, "unknown msg %04x wp=%08x lp=%08lx\n",
94 uMsg
, wParam
, lParam
);
95 return DefWindowProc32A (hwnd
, uMsg
, wParam
, lParam
);
102 MONTHCAL_Register (VOID
)
104 WNDCLASS32A wndClass
;
106 if (GlobalFindAtom32A (MONTHCAL_CLASS32A
)) return;
108 ZeroMemory (&wndClass
, sizeof(WNDCLASS32A
));
109 wndClass
.style
= CS_GLOBALCLASS
;
110 wndClass
.lpfnWndProc
= (WNDPROC32
)MONTHCAL_WindowProc
;
111 wndClass
.cbClsExtra
= 0;
112 wndClass
.cbWndExtra
= sizeof(MONTHCAL_INFO
*);
113 wndClass
.hCursor
= LoadCursor32A (0, IDC_ARROW32A
);
114 wndClass
.hbrBackground
= (HBRUSH32
)(COLOR_WINDOW
+ 1);
115 wndClass
.lpszClassName
= MONTHCAL_CLASS32A
;
117 RegisterClass32A (&wndClass
);
122 MONTHCAL_Unregister (VOID
)
124 if (GlobalFindAtom32A (MONTHCAL_CLASS32A
))
125 UnregisterClass32A (MONTHCAL_CLASS32A
, (HINSTANCE32
)NULL
);