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.
19 #include "ipaddress.h"
24 #define IPADDRESS_GetInfoPtr(wndPtr) ((IPADDRESS_INFO *)wndPtr->wExtra[0])
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");
45 if ((IPADDRESS_INFO
*)wndPtr
->wExtra
[0] != infoPtr
) {
46 ERR (listview
, "pointer assignment error!\n");
50 /* initialize info structure */
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
);
78 IPADDRESS_WindowProc (HWND32 hwnd
, UINT32 uMsg
, WPARAM32 wParam
, LPARAM lParam
)
80 WND
*wndPtr
= WIN_FindWndPtr(hwnd
);
84 // case IPM_CLEARADDRESS:
85 // case IPM_GETADDRESS:
87 // case IPM_SETADDRESS:
93 return IPADDRESS_Create (wndPtr
, wParam
, lParam
);
96 return IPADDRESS_Destroy (wndPtr
, wParam
, lParam
);
100 ERR (ipaddress
, "unknown msg %04x wp=%08x lp=%08lx\n",
101 uMsg
, wParam
, lParam
);
102 return DefWindowProc32A (hwnd
, uMsg
, wParam
, lParam
);
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
);
129 IPADDRESS_Unregister (VOID
)
131 if (GlobalFindAtom32A (WC_IPADDRESS32A
))
132 UnregisterClass32A (WC_IPADDRESS32A
, (HINSTANCE32
)NULL
);