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.
19 #include "debugtools.h"
21 DEFAULT_DEBUG_CHANNEL(nativefont);
25 DWORD dwDummy; /* just to keep the compiler happy ;-) */
28 #define NATIVEFONT_GetInfoPtr(hwnd) ((NATIVEFONT_INFO *)GetWindowLongA (hwnd, 0))
32 NATIVEFONT_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
34 NATIVEFONT_INFO *infoPtr;
36 /* allocate memory for info structure */
37 infoPtr = (NATIVEFONT_INFO *)COMCTL32_Alloc (sizeof(NATIVEFONT_INFO));
38 SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
41 /* initialize info structure */
49 NATIVEFONT_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
51 NATIVEFONT_INFO *infoPtr = NATIVEFONT_GetInfoPtr (hwnd);
56 /* free comboex info data */
57 COMCTL32_Free (infoPtr);
65 NATIVEFONT_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
71 return NATIVEFONT_Create (hwnd, wParam, lParam);
74 return NATIVEFONT_Destroy (hwnd, wParam, lParam);
77 ERR("unknown msg %04x wp=%08x lp=%08lx\n",
78 uMsg, wParam, lParam);
79 return DefWindowProcA (hwnd, uMsg, wParam, lParam);
86 NATIVEFONT_Register (void)
90 ZeroMemory (&wndClass, sizeof(WNDCLASSA));
91 wndClass.style = CS_GLOBALCLASS;
92 wndClass.lpfnWndProc = (WNDPROC)NATIVEFONT_WindowProc;
93 wndClass.cbClsExtra = 0;
94 wndClass.cbWndExtra = sizeof(NATIVEFONT_INFO *);
95 wndClass.hCursor = LoadCursorA (0, IDC_ARROWA);
96 wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
97 wndClass.lpszClassName = WC_NATIVEFONTCTLA;
99 RegisterClassA (&wndClass);
104 NATIVEFONT_Unregister (void)
106 UnregisterClassA (WC_NATIVEFONTCTLA, (HINSTANCE)NULL);