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.
17 #include "nativefont.h"
22 #define NATIVEFONT_GetInfoPtr(wndPtr) ((NATIVEFONT_INFO *)wndPtr->wExtra[0])
28 NATIVEFONT_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
30 NATIVEFONT_INFO *infoPtr;
32 /* allocate memory for info structure */
33 infoPtr = (NATIVEFONT_INFO *)COMCTL32_Alloc (sizeof(NATIVEFONT_INFO));
34 wndPtr->wExtra[0] = (DWORD)infoPtr;
36 if (infoPtr == NULL) {
37 ERR (listview, "could not allocate info memory!\n");
41 if ((NATIVEFONT_INFO*)wndPtr->wExtra[0] != infoPtr) {
42 ERR (listview, "pointer assignment error!\n");
46 /* initialize info structure */
54 NATIVEFONT_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
56 NATIVEFONT_INFO *infoPtr = NATIVEFONT_GetInfoPtr(wndPtr);
61 /* free comboex info data */
62 COMCTL32_Free (infoPtr);
70 NATIVEFONT_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
72 WND *wndPtr = WIN_FindWndPtr(hwnd);
78 return NATIVEFONT_Create (wndPtr, wParam, lParam);
81 return NATIVEFONT_Destroy (wndPtr, wParam, lParam);
84 ERR (nativefont, "unknown msg %04x wp=%08x lp=%08lx\n",
85 uMsg, wParam, lParam);
86 return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
93 NATIVEFONT_Register (VOID)
97 if (GlobalFindAtom32A (WC_NATIVEFONTCTL32A)) return;
99 ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
100 wndClass.style = CS_GLOBALCLASS;
101 wndClass.lpfnWndProc = (WNDPROC32)NATIVEFONT_WindowProc;
102 wndClass.cbClsExtra = 0;
103 wndClass.cbWndExtra = sizeof(NATIVEFONT_INFO *);
104 wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);
105 wndClass.hbrBackground = (HBRUSH32)(COLOR_WINDOW + 1);
106 wndClass.lpszClassName = WC_NATIVEFONTCTL32A;
108 RegisterClass32A (&wndClass);
113 NATIVEFONT_Unregister (VOID)
115 if (GlobalFindAtom32A (WC_NATIVEFONTCTL32A))
116 UnregisterClass32A (WC_NATIVEFONTCTL32A, (HINSTANCE32)NULL);