2 * ReactOS Column List Box
3 * Copyright (C) 2005 Thomas Weidenmueller
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 * PROJECT: ReactOS Column List Box
22 * PURPOSE: Column List Box
23 * PROGRAMMER: Thomas Weidenmueller <w3seek@reactos.com>
30 static HINSTANCE hDllInstance
;
32 static const WCHAR ClbClassName
[] = L
"ColumnListBox";
33 static const WCHAR ClbColumns
[] = L
"Column1;Column2;Column3";
35 typedef struct _CLB_PRIVATEDATA
38 } CLB_PRIVATEDATA
, *PCLB_PRIVATEDATA
;
40 static const CLBS_INFO ClbsSupportedStyles
[] =
55 L
"CLBS_DISABLENOSCROLL"
70 L
"CLBS_POPOUT_HEADINGS"
73 CLBS_SPRINGLY_COLUMNS
,
75 L
"CLBS_SPRINGLY_COLUMNS"
89 ClbAddData(IN DWORD Unknown1
,
93 DPRINT1("ClbAddData(0x%x, 0x%x, 0x%x)\n", Unknown1
, Unknown2
, Unknown3
);
103 ClbSetColumnWidths(IN DWORD Unknown1
,
107 DPRINT1("ClbSetColumnWidths(0x%x, 0x%x, 0x%x)\n", Unknown1
, Unknown2
, Unknown3
);
117 ClbWndProc(IN HWND hwnd
,
122 PCLB_PRIVATEDATA PrivData
;
125 DPRINT1("ClbWndProc(0x%p, 0x%x, 0x%p, 0x%p)\n", hwnd
, uMsg
, wParam
, lParam
);
127 PrivData
= (PCLB_PRIVATEDATA
)GetWindowLongPtr(hwnd
,
129 if (PrivData
== NULL
&& uMsg
!= WM_CREATE
)
137 PrivData
= HeapAlloc(GetProcessHeap(),
139 sizeof(CLB_PRIVATEDATA
));
140 if (PrivData
== NULL
)
145 PrivData
->hwnd
= hwnd
;
149 HeapFree(GetProcessHeap(),
156 Ret
= DefWindowProc(hwnd
,
167 static INT_PTR CALLBACK
168 ClbpStyleDlgProc(IN HWND hwndDlg
,
175 DPRINT1("ClbpStyleDlgProc(0x%p, 0x%x, 0x%p, 0x%p)\n", hwndDlg
, uMsg
, wParam
, lParam
);
180 switch (LOWORD(wParam
))
185 (INT_PTR
)LOWORD(wParam
));
209 ClbStyleW(IN HWND hWndParent
,
210 IN LPARAM dwInitParam
)
212 return DialogBoxParam(hDllInstance
,
213 MAKEINTRESOURCE(IDD_COLUMNLISTBOXSTYLES
),
225 CustomControlInfoW(OUT LPCUSTOM_CONTROL_INFO CustomControlInfo OPTIONAL
)
227 if (CustomControlInfo
!= NULL
)
229 wcscpy(CustomControlInfo
->ClassName
,
232 CustomControlInfo
->Zero1
= 0;
234 wcscpy(CustomControlInfo
->ClassName2
,
237 CustomControlInfo
->Unknown1
= 0x60; /* FIXME - ??? */
238 CustomControlInfo
->Unknown2
= 0x50; /* FIXME - ??? */
239 CustomControlInfo
->Unknown3
= 0x50A10013; /* FIXME - ??? */
241 CustomControlInfo
->Zero2
= 0;
242 CustomControlInfo
->Zero3
= 0;
244 CustomControlInfo
->StylesCount
= sizeof(ClbsSupportedStyles
) / sizeof(ClbsSupportedStyles
[0]);
245 CustomControlInfo
->SupportedStyles
= ClbsSupportedStyles
;
247 wcscpy(CustomControlInfo
->Columns
,
250 CustomControlInfo
->ClbStyleW
= ClbStyleW
;
252 CustomControlInfo
->Zero4
= 0;
253 CustomControlInfo
->Zero5
= 0;
254 CustomControlInfo
->Zero6
= 0;
262 DllMain(IN HINSTANCE hinstDLL
,
264 IN LPVOID lpvReserved
)
270 case DLL_PROCESS_ATTACH
:
272 WNDCLASS ClbWndClass
;
274 hDllInstance
= hinstDLL
;
276 InitCommonControls();
278 /* register the control's window class */
279 ClbWndClass
.style
= CS_GLOBALCLASS
| CS_OWNDC
;
280 ClbWndClass
.lpfnWndProc
= ClbWndProc
;
281 ClbWndClass
.cbClsExtra
= 0;
282 ClbWndClass
.cbWndExtra
= sizeof(PCLB_PRIVATEDATA
);
283 ClbWndClass
.hInstance
= hinstDLL
,
284 ClbWndClass
.hIcon
= NULL
;
285 ClbWndClass
.hCursor
= LoadCursor(NULL
,
287 ClbWndClass
.hbrBackground
= NULL
;
288 ClbWndClass
.lpszMenuName
= NULL
;
289 ClbWndClass
.lpszClassName
= ClbClassName
;
291 if (!RegisterClass(&ClbWndClass
))
299 case DLL_THREAD_ATTACH
:
300 case DLL_THREAD_DETACH
:
303 case DLL_PROCESS_DETACH
:
304 UnregisterClass(ClbClassName
,