- new interface declaration for IShellfolder2
[wine/dcerpc.git] / dlls / comctl32 / nativefont.c
blob33ee44f62c4c21c983fb98d9ce668b5d4618423d
1 /*
2 * Native Font 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.
16 #include "winbase.h"
17 #include "commctrl.h"
18 #include "nativefont.h"
19 #include "debugtools.h"
21 DEFAULT_DEBUG_CHANNEL(nativefont)
24 #define NATIVEFONT_GetInfoPtr(hwnd) ((NATIVEFONT_INFO *)GetWindowLongA (hwnd, 0))
29 static LRESULT
30 NATIVEFONT_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
32 NATIVEFONT_INFO *infoPtr;
34 /* allocate memory for info structure */
35 infoPtr = (NATIVEFONT_INFO *)COMCTL32_Alloc (sizeof(NATIVEFONT_INFO));
36 SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
39 /* initialize info structure */
42 return 0;
46 static LRESULT
47 NATIVEFONT_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
49 NATIVEFONT_INFO *infoPtr = NATIVEFONT_GetInfoPtr (hwnd);
54 /* free comboex info data */
55 COMCTL32_Free (infoPtr);
57 return 0;
62 static LRESULT WINAPI
63 NATIVEFONT_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
65 switch (uMsg)
68 case WM_CREATE:
69 return NATIVEFONT_Create (hwnd, wParam, lParam);
71 case WM_DESTROY:
72 return NATIVEFONT_Destroy (hwnd, wParam, lParam);
74 default:
75 ERR("unknown msg %04x wp=%08x lp=%08lx\n",
76 uMsg, wParam, lParam);
77 return DefWindowProcA (hwnd, uMsg, wParam, lParam);
79 return 0;
83 VOID
84 NATIVEFONT_Register (void)
86 WNDCLASSA wndClass;
88 if (GlobalFindAtomA (WC_NATIVEFONTCTLA)) return;
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);
103 VOID
104 NATIVEFONT_Unregister (void)
106 if (GlobalFindAtomA (WC_NATIVEFONTCTLA))
107 UnregisterClassA (WC_NATIVEFONTCTLA, (HINSTANCE)NULL);