Fixed differences between SetRectRgn16 and SetRectRgn32. Also a bug fix for
[wine/multimedia.git] / dlls / comctl32 / ipaddress.c
blob34570e7960bc5b32b5fc59870ebaed382938b0c3
1 /*
2 * IP Address 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.
17 #include "windows.h"
18 #include "commctrl.h"
19 #include "ipaddress.h"
20 #include "win.h"
21 #include "debug.h"
24 #define IPADDRESS_GetInfoPtr(wndPtr) ((IPADDRESS_INFO *)wndPtr->wExtra[0])
31 static LRESULT
32 IPADDRESS_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
34 IPADDRESS_INFO *infoPtr;
36 /* allocate memory for info structure */
37 infoPtr = (IPADDRESS_INFO *)COMCTL32_Alloc (sizeof(IPADDRESS_INFO));
38 wndPtr->wExtra[0] = (DWORD)infoPtr;
40 if (infoPtr == NULL) {
41 ERR (listview, "could not allocate info memory!\n");
42 return 0;
45 if ((IPADDRESS_INFO*)wndPtr->wExtra[0] != infoPtr) {
46 ERR (listview, "pointer assignment error!\n");
47 return 0;
50 /* initialize info structure */
54 return 0;
58 static LRESULT
59 IPADDRESS_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
61 IPADDRESS_INFO *infoPtr = IPADDRESS_GetInfoPtr(wndPtr);
68 /* free ipaddress info data */
69 COMCTL32_Free (infoPtr);
71 return 0;
77 LRESULT WINAPI
78 IPADDRESS_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
80 WND *wndPtr = WIN_FindWndPtr(hwnd);
82 switch (uMsg)
84 // case IPM_CLEARADDRESS:
85 // case IPM_GETADDRESS:
86 // case IPM_ISBLANK:
87 // case IPM_SETADDRESS:
88 // case IPM_SETFOCUS:
89 // case IPM_SETRANGE:
92 case WM_CREATE:
93 return IPADDRESS_Create (wndPtr, wParam, lParam);
95 case WM_DESTROY:
96 return IPADDRESS_Destroy (wndPtr, wParam, lParam);
98 default:
99 if (uMsg >= WM_USER)
100 ERR (ipaddress, "unknown msg %04x wp=%08x lp=%08lx\n",
101 uMsg, wParam, lParam);
102 return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
104 return 0;
108 VOID
109 IPADDRESS_Register (VOID)
111 WNDCLASS32A wndClass;
113 if (GlobalFindAtom32A (WC_IPADDRESS32A)) return;
115 ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
116 wndClass.style = CS_GLOBALCLASS;
117 wndClass.lpfnWndProc = (WNDPROC32)IPADDRESS_WindowProc;
118 wndClass.cbClsExtra = 0;
119 wndClass.cbWndExtra = sizeof(IPADDRESS_INFO *);
120 wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);
121 wndClass.hbrBackground = (HBRUSH32)(COLOR_WINDOW + 1);
122 wndClass.lpszClassName = WC_IPADDRESS32A;
124 RegisterClass32A (&wndClass);
128 VOID
129 IPADDRESS_Unregister (VOID)
131 if (GlobalFindAtom32A (WC_IPADDRESS32A))
132 UnregisterClass32A (WC_IPADDRESS32A, (HINSTANCE32)NULL);