New debug scheme with explicit debug channels declaration.
[wine/hacks.git] / dlls / comctl32 / monthcal.c
blob5089882fe527d8b3b4eb27bdb71d442da27eb208
1 /*
2 * Month calendar control
4 * Copyright 1998, 1999 Eric Kohl
6 * NOTES
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>
11 * TODO:
12 * - All messages.
13 * - All notifications.
17 #include "winbase.h"
18 #include "commctrl.h"
19 #include "monthcal.h"
20 #include "debug.h"
22 DEFAULT_DEBUG_CHANNEL(monthcal)
25 #define MONTHCAL_GetInfoPtr(hwnd) ((MONTHCAL_INFO *)GetWindowLongA (hwnd, 0))
32 static LRESULT
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 */
46 return 0;
50 static LRESULT
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);
63 return 0;
69 LRESULT WINAPI
70 MONTHCAL_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
72 switch (uMsg)
76 case WM_CREATE:
77 return MONTHCAL_Create (hwnd, wParam, lParam);
79 case WM_DESTROY:
80 return MONTHCAL_Destroy (hwnd, wParam, lParam);
82 default:
83 if (uMsg >= WM_USER)
84 ERR (monthcal, "unknown msg %04x wp=%08x lp=%08lx\n",
85 uMsg, wParam, lParam);
86 return DefWindowProcA (hwnd, uMsg, wParam, lParam);
88 return 0;
92 VOID
93 MONTHCAL_Register (VOID)
95 WNDCLASSA wndClass;
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);
112 VOID
113 MONTHCAL_Unregister (VOID)
115 if (GlobalFindAtomA (MONTHCAL_CLASSA))
116 UnregisterClassA (MONTHCAL_CLASSA, (HINSTANCE)NULL);