Removed extra output.
[wine/multimedia.git] / dlls / comctl32 / nativefont.c
blobc4ae462f5947fb93238df214c8d55ada86fdc0de
1 /*
2 * Native Font control
4 * Copyright 1998 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 "windows.h"
17 #include "commctrl.h"
18 #include "nativefont.h"
19 #include "win.h"
20 #include "debug.h"
23 #define NATIVEFONT_GetInfoPtr(wndPtr) ((NATIVEFONT_INFO *)wndPtr->wExtra[0])
28 static LRESULT
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");
39 return 0;
42 if ((NATIVEFONT_INFO*)wndPtr->wExtra[0] != infoPtr) {
43 ERR (listview, "pointer assignment error!\n");
44 return 0;
47 /* initialize info structure */
50 return 0;
54 static LRESULT
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);
65 return 0;
70 LRESULT WINAPI
71 NATIVEFONT_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
73 WND *wndPtr = WIN_FindWndPtr(hwnd);
75 switch (uMsg)
78 case WM_CREATE:
79 return NATIVEFONT_Create (wndPtr, wParam, lParam);
81 case WM_DESTROY:
82 return NATIVEFONT_Destroy (wndPtr, wParam, lParam);
84 default:
85 ERR (nativefont, "unknown msg %04x wp=%08x lp=%08lx\n",
86 uMsg, wParam, lParam);
87 return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
89 return 0;
93 VOID
94 NATIVEFONT_Register (VOID)
96 WNDCLASS32A wndClass;
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);
113 VOID
114 NATIVEFONT_Unregister (VOID)
116 if (GlobalFindAtom32A (WC_NATIVEFONTCTL32A))
117 UnregisterClass32A (WC_NATIVEFONTCTL32A, (HINSTANCE32)NULL);