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.
18 #include "nativefont.h"
23 #define NATIVEFONT_GetInfoPtr(wndPtr) ((NATIVEFONT_INFO *)wndPtr->wExtra[0])
29 NATIVEFONT_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
31 NATIVEFONT_INFO *infoPtr;
33 /* allocate memory for info structure */
34 infoPtr = (NATIVEFONT_INFO *)COMCTL32_Alloc (sizeof(NATIVEFONT_INFO));
35 wndPtr->wExtra[0] = (DWORD)infoPtr;
37 if (infoPtr == NULL) {
38 ERR (listview, "could not allocate info memory!\n");
42 if ((NATIVEFONT_INFO*)wndPtr->wExtra[0] != infoPtr) {
43 ERR (listview, "pointer assignment error!\n");
47 /* initialize info structure */
55 NATIVEFONT_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
57 NATIVEFONT_INFO *infoPtr = NATIVEFONT_GetInfoPtr(wndPtr);
62 /* free comboex info data */
63 COMCTL32_Free (infoPtr);
71 NATIVEFONT_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
73 WND *wndPtr = WIN_FindWndPtr(hwnd);
79 return NATIVEFONT_Create (wndPtr, wParam, lParam);
82 return NATIVEFONT_Destroy (wndPtr, wParam, lParam);
85 ERR (nativefont, "unknown msg %04x wp=%08x lp=%08lx\n",
86 uMsg, wParam, lParam);
87 return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
94 NATIVEFONT_Register (VOID)
98 if (GlobalFindAtom32A (WC_NATIVEFONTCTL32A)) return;
100 ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
101 wndClass.style = CS_GLOBALCLASS;
102 wndClass.lpfnWndProc = (WNDPROC32)NATIVEFONT_WindowProc;
103 wndClass.cbClsExtra = 0;
104 wndClass.cbWndExtra = sizeof(NATIVEFONT_INFO *);
105 wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);
106 wndClass.hbrBackground = (HBRUSH32)(COLOR_WINDOW + 1);
107 wndClass.lpszClassName = WC_NATIVEFONTCTL32A;
109 RegisterClass32A (&wndClass);
114 NATIVEFONT_Unregister (VOID)
116 if (GlobalFindAtom32A (WC_NATIVEFONTCTL32A))
117 UnregisterClass32A (WC_NATIVEFONTCTL32A, (HINSTANCE32)NULL);