2 * Month calendar control
4 * Copyright 1998, 1999 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.
22 DEFAULT_DEBUG_CHANNEL(monthcal
)
25 #define MONTHCAL_GetInfoPtr(hwnd) ((MONTHCAL_INFO *)GetWindowLongA (hwnd, 0))
33 MONTHCAL_Create (HWND hwnd
, WPARAM wParam
, LPARAM lParam
)
35 MONTHCAL_INFO
*infoPtr
;
37 /* allocate memory for info structure */
38 infoPtr
= (MONTHCAL_INFO
*)COMCTL32_Alloc (sizeof(MONTHCAL_INFO
));
39 SetWindowLongA (hwnd
, 0, (DWORD
)infoPtr
);
42 /* initialize info structure */
51 MONTHCAL_Destroy (HWND hwnd
, WPARAM wParam
, LPARAM lParam
)
53 MONTHCAL_INFO
*infoPtr
= MONTHCAL_GetInfoPtr (hwnd
);
60 /* free ipaddress info data */
61 COMCTL32_Free (infoPtr
);
70 MONTHCAL_WindowProc (HWND hwnd
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
77 return MONTHCAL_Create (hwnd
, wParam
, lParam
);
80 return MONTHCAL_Destroy (hwnd
, wParam
, lParam
);
84 ERR (monthcal
, "unknown msg %04x wp=%08x lp=%08lx\n",
85 uMsg
, wParam
, lParam
);
86 return DefWindowProcA (hwnd
, uMsg
, wParam
, lParam
);
93 MONTHCAL_Register (VOID
)
97 if (GlobalFindAtomA (MONTHCAL_CLASSA
)) return;
99 ZeroMemory (&wndClass
, sizeof(WNDCLASSA
));
100 wndClass
.style
= CS_GLOBALCLASS
;
101 wndClass
.lpfnWndProc
= (WNDPROC
)MONTHCAL_WindowProc
;
102 wndClass
.cbClsExtra
= 0;
103 wndClass
.cbWndExtra
= sizeof(MONTHCAL_INFO
*);
104 wndClass
.hCursor
= LoadCursorA (0, IDC_ARROWA
);
105 wndClass
.hbrBackground
= (HBRUSH
)(COLOR_WINDOW
+ 1);
106 wndClass
.lpszClassName
= MONTHCAL_CLASSA
;
108 RegisterClassA (&wndClass
);
113 MONTHCAL_Unregister (VOID
)
115 if (GlobalFindAtomA (MONTHCAL_CLASSA
))
116 UnregisterClassA (MONTHCAL_CLASSA
, (HINSTANCE
)NULL
);