ReactOS 0.4.15-dev-6661-gcc6e444
clb.c
Go to the documentation of this file.
1/*
2 * ReactOS Column List Box
3 * Copyright (C) 2005 Thomas Weidenmueller
4 *
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.
9 *
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.
14 *
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
18 */
19/*
20 * PROJECT: ReactOS Column List Box
21 * FILE: base/applications/regedit/clb/clb.c
22 * PURPOSE: Column List Box
23 * PROGRAMMER: Thomas Weidenmueller <w3seek@reactos.com>
24 *
25 * UPDATE HISTORY:
26 * 10/29/2005 Created
27 */
28#include <precomp.h>
29
31
32static const WCHAR ClbClassName[] = L"ColumnListBox";
33static const WCHAR ClbColumns[] = L"Column1;Column2;Column3";
34
35typedef struct _CLB_PRIVATEDATA
36{
39
41{
42 {
44 0x0,
45 L"CLBS_NOTIFY"
46 },
47 {
49 0x0,
50 L"CLBS_SORT"
51 },
52 {
54 0x0,
55 L"CLBS_DISABLENOSCROLL"
56 },
57 {
59 0x0,
60 L"CLBS_VSCROLL"
61 },
62 {
64 0x0,
65 L"CLBS_BORDER"
66 },
67 {
69 0x0,
70 L"CLBS_POPOUT_HEADINGS"
71 },
72 {
74 0x0,
75 L"CLBS_SPRINGLY_COLUMNS"
76 },
77 {
79 0x0,
80 L"LBS_OWNERDRAWFIXED"
81 }
82};
83
84/*
85 * @unimplemented
86 */
90 IN DWORD Unknown2,
92{
93 DPRINT1("ClbAddData(0x%x, 0x%x, 0x%x)\n", Unknown1, Unknown2, Unknown3);
94 return 0;
95}
96
97
98/*
99 * @unimplemented
100 */
101DWORD
102WINAPI
104 IN DWORD Unknown2,
106{
107 DPRINT1("ClbSetColumnWidths(0x%x, 0x%x, 0x%x)\n", Unknown1, Unknown2, Unknown3);
108 return 0;
109}
110
111
112/*
113 * @unimplemented
114 */
118 IN UINT uMsg,
121{
122 PCLB_PRIVATEDATA PrivData;
123 LRESULT Ret = 0;
124
125 DPRINT1("ClbWndProc(0x%p, 0x%x, 0x%p, 0x%p)\n", hwnd, uMsg, wParam, lParam);
126
128 0);
129 if (PrivData == NULL && uMsg != WM_CREATE)
130 {
131 goto HandleDefMsg;
132 }
133
134 switch (uMsg)
135 {
136 case WM_CREATE:
137 PrivData = HeapAlloc(GetProcessHeap(),
138 0,
139 sizeof(CLB_PRIVATEDATA));
140 if (PrivData == NULL)
141 {
142 Ret = (LRESULT)-1;
143 break;
144 }
145 PrivData->hwnd = hwnd;
146 break;
147
148 case WM_DESTROY:
150 0,
151 PrivData);
152 break;
153
154 default:
155HandleDefMsg:
156 Ret = DefWindowProc(hwnd,
157 uMsg,
158 wParam,
159 lParam);
160 break;
161 }
162
163 return Ret;
164}
165
166
167static INT_PTR CALLBACK
169 IN UINT uMsg,
172{
173 INT_PTR Ret = FALSE;
174
175 DPRINT1("ClbpStyleDlgProc(0x%p, 0x%x, 0x%p, 0x%p)\n", hwndDlg, uMsg, wParam, lParam);
176
177 switch (uMsg)
178 {
179 case WM_COMMAND:
180 switch (LOWORD(wParam))
181 {
182 case IDOK:
183 case IDCANCEL:
184 EndDialog(hwndDlg,
186 break;
187 }
188 break;
189
190 case WM_CLOSE:
191 EndDialog(hwndDlg,
192 IDCANCEL);
193 break;
194
195 case WM_INITDIALOG:
196 Ret = TRUE;
197 break;
198 }
199
200 return Ret;
201}
202
203
204/*
205 * @implemented
206 */
208WINAPI
210 IN LPARAM dwInitParam)
211{
216 dwInitParam);
217}
218
219
220/*
221 * @implemented
222 */
223BOOL
224WINAPI
226{
227 if (CustomControlInfo != NULL)
228 {
229 wcscpy(CustomControlInfo->ClassName,
231
232 CustomControlInfo->Zero1 = 0;
233
234 wcscpy(CustomControlInfo->ClassName2,
236
237 CustomControlInfo->Unknown1 = 0x60; /* FIXME - ??? */
238 CustomControlInfo->Unknown2 = 0x50; /* FIXME - ??? */
239 CustomControlInfo->Unknown3 = 0x50A10013; /* FIXME - ??? */
240
241 CustomControlInfo->Zero2 = 0;
242 CustomControlInfo->Zero3 = 0;
243
244 CustomControlInfo->StylesCount = sizeof(ClbsSupportedStyles) / sizeof(ClbsSupportedStyles[0]);
245 CustomControlInfo->SupportedStyles = ClbsSupportedStyles;
246
247 wcscpy(CustomControlInfo->Columns,
248 ClbColumns);
249
250 CustomControlInfo->ClbStyleW = ClbStyleW;
251
252 CustomControlInfo->Zero4 = 0;
253 CustomControlInfo->Zero5 = 0;
254 CustomControlInfo->Zero6 = 0;
255 }
256
257 return TRUE;
258}
259
260BOOL
261WINAPI
265{
266 BOOL Ret = TRUE;
267
268 switch (dwReason)
269 {
271 {
272 WNDCLASS ClbWndClass;
273
274 hDllInstance = hinstDLL;
275
277
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;
290
291 if (!RegisterClass(&ClbWndClass))
292 {
293 Ret = FALSE;
294 break;
295 }
296 break;
297 }
298
301 break;
302
305 hinstDLL);
306 break;
307 }
308 return Ret;
309}
310
311/* EOF */
#define DPRINT1
Definition: precomp.h:8
#define IDD_COLUMNLISTBOXSTYLES
Definition: resource.h:3
DWORD dwReason
Definition: misc.cpp:154
LRESULT CALLBACK ClbWndProc(IN HWND hwnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: clb.c:117
static const WCHAR ClbColumns[]
Definition: clb.c:33
DWORD WINAPI ClbAddData(IN DWORD Unknown1, IN DWORD Unknown2, IN DWORD Unknown3)
Definition: clb.c:89
static const WCHAR ClbClassName[]
Definition: clb.c:32
struct _CLB_PRIVATEDATA * PCLB_PRIVATEDATA
BOOL WINAPI DllMain(IN HINSTANCE hinstDLL, IN DWORD dwReason, IN LPVOID lpvReserved)
Definition: clb.c:262
BOOL WINAPI CustomControlInfoW(OUT LPCUSTOM_CONTROL_INFO CustomControlInfo OPTIONAL)
Definition: clb.c:225
DWORD WINAPI ClbSetColumnWidths(IN DWORD Unknown1, IN DWORD Unknown2, IN DWORD Unknown3)
Definition: clb.c:103
INT_PTR WINAPI ClbStyleW(IN HWND hWndParent, IN LPARAM dwInitParam)
Definition: clb.c:209
struct _CLB_PRIVATEDATA CLB_PRIVATEDATA
static INT_PTR CALLBACK ClbpStyleDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: clb.c:168
static const CLBS_INFO ClbsSupportedStyles[]
Definition: clb.c:40
static HINSTANCE hDllInstance
Definition: clb.c:30
#define CLBS_NOTIFY
Definition: clbdll.h:3
#define CLBS_VSCROLL
Definition: clbdll.h:6
#define CLBS_SPRINGLY_COLUMNS
Definition: clbdll.h:9
#define CLBS_DISABLENOSCROLL
Definition: clbdll.h:5
#define CLBS_BORDER
Definition: clbdll.h:7
#define CLBS_SORT
Definition: clbdll.h:4
#define CLBS_POPOUT_HEADINGS
Definition: clbdll.h:8
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
VOID WINAPI InitCommonControls(void)
Definition: commctrl.c:863
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES IN DWORD Unknown3
Definition: conport.c:37
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcessHeap()
Definition: compat.h:736
#define DLL_THREAD_DETACH
Definition: compat.h:133
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
#define DLL_THREAD_ATTACH
Definition: compat.h:132
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
static IN DWORD IN LPVOID lpvReserved
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
#define LRESULT
Definition: ole.h:14
#define LOWORD(l)
Definition: pedump.c:82
#define LBS_OWNERDRAWFIXED
Definition: pedump.c:682
#define DefWindowProc
Definition: ros2win.h:31
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
HWND hwnd
Definition: clb.c:37
HBRUSH hbrBackground
Definition: winuser.h:3160
HICON hIcon
Definition: winuser.h:3158
HINSTANCE hInstance
Definition: winuser.h:3157
HCURSOR hCursor
Definition: winuser.h:3159
int cbWndExtra
Definition: winuser.h:3156
UINT style
Definition: winuser.h:3153
LPCSTR lpszMenuName
Definition: winuser.h:3161
LPCSTR lpszClassName
Definition: winuser.h:3162
WNDPROC lpfnWndProc
Definition: winuser.h:3154
int cbClsExtra
Definition: winuser.h:3155
#define GetWindowLongPtr
Definition: treelist.c:73
int32_t INT_PTR
Definition: typedefs.h:64
#define IN
Definition: typedefs.h:39
#define OUT
Definition: typedefs.h:40
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define WM_CLOSE
Definition: winuser.h:1611
#define IDCANCEL
Definition: winuser.h:825
#define WM_CREATE
Definition: winuser.h:1598
#define WM_COMMAND
Definition: winuser.h:1730
#define IDC_ARROW
Definition: winuser.h:682
#define UnregisterClass
Definition: winuser.h:5851
#define DialogBoxParam
Definition: winuser.h:5754
#define WM_INITDIALOG
Definition: winuser.h:1729
#define IDOK
Definition: winuser.h:824
#define LoadCursor
Definition: winuser.h:5802
#define CS_GLOBALCLASS
Definition: winuser.h:647
#define CS_OWNDC
Definition: winuser.h:650
#define RegisterClass
Definition: winuser.h:5826
#define WM_DESTROY
Definition: winuser.h:1599
#define MAKEINTRESOURCE
Definition: winuser.h:591
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184