From cd88496c7ac34c6eb57132c622391f44fed8fbe8 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Thu, 29 Sep 2005 16:55:59 +0000 Subject: [PATCH] added clb.dll (mostly just stubs) which is required by MS regedit for it's REG_FULL_RESOURCE_DESCRIPTOR editor. As there doesn't seem to be another application that uses it, this place is probably the best for it. svn path=/trunk/; revision=18157 --- reactos/baseaddress.xml | 1 + reactos/bootdata/packages/reactos.dff | 1 + reactos/subsys/system/regedit/clb/clb.c | 310 +++++++++++++++++++ reactos/subsys/system/regedit/clb/clb.def | 10 + reactos/subsys/system/regedit/clb/clb.rc | 12 + reactos/subsys/system/regedit/clb/clb.xml | 18 ++ reactos/subsys/system/regedit/clb/clb_En.rc | 28 ++ reactos/subsys/system/regedit/clb/clbdll.h | 43 +++ reactos/subsys/system/regedit/clb/precomp.h | 10 + reactos/subsys/system/regedit/clb/resource.h | 6 + reactos/subsys/system/regedit/regedit.xml | 3 + 11 files changed, 442 insertions(+) create mode 100644 reactos/subsys/system/regedit/clb/clb.c create mode 100644 reactos/subsys/system/regedit/clb/clb.def create mode 100644 reactos/subsys/system/regedit/clb/clb.rc create mode 100644 reactos/subsys/system/regedit/clb/clb.xml create mode 100644 reactos/subsys/system/regedit/clb/clb_En.rc create mode 100644 reactos/subsys/system/regedit/clb/clbdll.h create mode 100644 reactos/subsys/system/regedit/clb/precomp.h create mode 100644 reactos/subsys/system/regedit/clb/resource.h diff --git a/reactos/baseaddress.xml b/reactos/baseaddress.xml index 615736519ae..32bbd79dbc7 100644 --- a/reactos/baseaddress.xml +++ b/reactos/baseaddress.xml @@ -29,6 +29,7 @@ + diff --git a/reactos/bootdata/packages/reactos.dff b/reactos/bootdata/packages/reactos.dff index 059dba49b3c..6e9907f7f6c 100755 --- a/reactos/bootdata/packages/reactos.dff +++ b/reactos/bootdata/packages/reactos.dff @@ -174,6 +174,7 @@ subsys\system\ibrowser\ibrowser.exe 1 subsys\system\msiexec\msiexec.exe 1 subsys\system\notepad\notepad.exe 1 subsys\system\regedit\regedit.exe 4 +subsys\system\regedit\clb\clb.dll 1 subsys\system\regsvr32\regsvr32.exe 1 subsys\system\reporterror\reporterror.exe 1 subsys\system\rundll32\rundll32.exe 1 diff --git a/reactos/subsys/system/regedit/clb/clb.c b/reactos/subsys/system/regedit/clb/clb.c new file mode 100644 index 00000000000..fe5010a772a --- /dev/null +++ b/reactos/subsys/system/regedit/clb/clb.c @@ -0,0 +1,310 @@ +/* + * ReactOS Column List Box + * Copyright (C) 2005 Thomas Weidenmueller + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +/* + * PROJECT: ReactOS Column List Box + * FILE: lib/clb/clb.c + * PURPOSE: Column List Box + * PROGRAMMER: Thomas Weidenmueller + * + * UPDATE HISTORY: + * 10/29/2005 Created + */ +#include + +static HINSTANCE hDllInstance; + +static const WCHAR ClbClassName[] = L"ColumnListBox"; +static const WCHAR ClbColumns[] = L"Column1;Column2;Column3"; + +typedef struct _CLB_PRIVATEDATA +{ + HWND hwnd; +} CLB_PRIVATEDATA, *PCLB_PRIVATEDATA; + +static const CLBS_INFO ClbsSupportedStyles[] = +{ + { + CLBS_NOTIFY, + 0x0, + L"CLBS_NOTIFY" + }, + { + CLBS_SORT, + 0x0, + L"CLBS_SORT" + }, + { + CLBS_DISABLENOSCROLL, + 0x0, + L"CLBS_DISABLENOSCROLL" + }, + { + CLBS_VSCROLL, + 0x0, + L"CLBS_VSCROLL" + }, + { + CLBS_BORDER, + 0x0, + L"CLBS_BORDER" + }, + { + CLBS_POPOUT_HEADINGS, + 0x0, + L"CLBS_POPOUT_HEADINGS" + }, + { + CLBS_SPRINGLY_COLUMNS, + 0x0, + L"CLBS_SPRINGLY_COLUMNS" + }, + { + LBS_OWNERDRAWFIXED, + 0x0, + L"LBS_OWNERDRAWFIXED" + } +}; + +/* + * @unimplemented + */ +DWORD +WINAPI +ClbAddData(IN DWORD Unknown1, + IN DWORD Unknown2, + IN DWORD Unknown3) +{ + DPRINT1("ClbAddData(0x%x, 0x%x, 0x%x)\n", Unknown1, Unknown2, Unknown3); + return 0; +} + + +/* + * @unimplemented + */ +DWORD +WINAPI +ClbSetColumnWidths(IN DWORD Unknown1, + IN DWORD Unknown2, + IN DWORD Unknown3) +{ + DPRINT1("ClbSetColumnWidths(0x%x, 0x%x, 0x%x)\n", Unknown1, Unknown2, Unknown3); + return 0; +} + + +/* + * @unimplemented + */ +LRESULT +CALLBACK +ClbWndProc(IN HWND hwnd, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + PCLB_PRIVATEDATA PrivData; + LRESULT Ret = 0; + + DPRINT1("ClbWndProc(0x%p, 0x%x, 0x%p, 0x%p)\n", hwnd, uMsg, wParam, lParam); + + PrivData = (PCLB_PRIVATEDATA)GetWindowLongPtr(hwnd, + 0); + if (PrivData == NULL && uMsg != WM_CREATE) + { + goto HandleDefMsg; + } + + switch (uMsg) + { + case WM_CREATE: + PrivData = HeapAlloc(GetProcessHeap(), + 0, + sizeof(CLB_PRIVATEDATA)); + if (PrivData == NULL) + { + Ret = (LRESULT)-1; + break; + } + PrivData->hwnd = hwnd; + break; + + case WM_DESTROY: + HeapFree(GetProcessHeap(), + 0, + PrivData); + break; + + default: +HandleDefMsg: + Ret = DefWindowProc(hwnd, + uMsg, + wParam, + lParam); + break; + } + + return Ret; +} + + +static INT_PTR CALLBACK +ClbpStyleDlgProc(IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + INT_PTR Ret = FALSE; + + DPRINT1("ClbpStyleDlgProc(0x%p, 0x%x, 0x%p, 0x%p)\n", hwndDlg, uMsg, wParam, lParam); + + switch (uMsg) + { + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDOK: + case IDCANCEL: + EndDialog(hwndDlg, + (INT_PTR)LOWORD(wParam)); + break; + } + break; + + case WM_CLOSE: + EndDialog(hwndDlg, + IDCANCEL); + break; + + case WM_INITDIALOG: + Ret = TRUE; + break; + } + + return Ret; +} + + +/* + * @implemented + */ +INT_PTR +WINAPI +ClbStyleW(IN HWND hWndParent, + IN LPARAM dwInitParam) +{ + return DialogBoxParam(hDllInstance, + MAKEINTRESOURCE(IDD_COLUMNLISTBOXSTYLES), + hWndParent, + ClbpStyleDlgProc, + dwInitParam); +} + + +/* + * @implemented + */ +BOOL +WINAPI +CustomControlInfoW(OUT LPCUSTOM_CONTROL_INFO CustomControlInfo OPTIONAL) +{ + if (CustomControlInfo != NULL) + { + wcscpy(CustomControlInfo->ClassName, + ClbClassName); + + CustomControlInfo->Zero1 = 0; + + wcscpy(CustomControlInfo->ClassName2, + ClbClassName); + + CustomControlInfo->Unknown1 = 0x60; /* FIXME - ??? */ + CustomControlInfo->Unknown2 = 0x50; /* FIXME - ??? */ + CustomControlInfo->Unknown3 = 0x50A10013; /* FIXME - ??? */ + + CustomControlInfo->Zero2 = 0; + CustomControlInfo->Zero3 = 0; + + CustomControlInfo->StylesCount = sizeof(ClbsSupportedStyles) / sizeof(ClbsSupportedStyles[0]); + CustomControlInfo->SupportedStyles = ClbsSupportedStyles; + + wcscpy(CustomControlInfo->Columns, + ClbColumns); + + CustomControlInfo->ClbStyleW = ClbStyleW; + + CustomControlInfo->Zero4 = 0; + CustomControlInfo->Zero5 = 0; + CustomControlInfo->Zero6 = 0; + } + + return TRUE; +} + +BOOL +WINAPI +DllMain(IN HINSTANCE hinstDLL, + IN DWORD dwReason, + IN LPVOID lpvReserved) +{ + BOOL Ret = TRUE; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + { + WNDCLASS ClbWndClass; + + hDllInstance = hinstDLL; + + InitCommonControls(); + + /* register the control's window class */ + ClbWndClass.style = CS_GLOBALCLASS | CS_OWNDC; + ClbWndClass.lpfnWndProc = ClbWndProc; + ClbWndClass.cbClsExtra = 0; + ClbWndClass.cbWndExtra = sizeof(PCLB_PRIVATEDATA); + ClbWndClass.hInstance = hinstDLL, + ClbWndClass.hIcon = NULL; + ClbWndClass.hCursor = LoadCursor(NULL, + (LPWSTR)IDC_ARROW); + ClbWndClass.hbrBackground = NULL; + ClbWndClass.lpszMenuName = NULL; + ClbWndClass.lpszClassName = ClbClassName; + + if (!RegisterClass(&ClbWndClass)) + { + Ret = FALSE; + break; + } + break; + } + + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + break; + + case DLL_PROCESS_DETACH: + UnregisterClass(ClbClassName, + hinstDLL); + break; + } + return Ret; +} + diff --git a/reactos/subsys/system/regedit/clb/clb.def b/reactos/subsys/system/regedit/clb/clb.def new file mode 100644 index 00000000000..9762bd1ebf9 --- /dev/null +++ b/reactos/subsys/system/regedit/clb/clb.def @@ -0,0 +1,10 @@ +LIBRARY clb.dll + +EXPORTS +ClbAddData@12 @1 +ClbSetColumnWidths@12 @2 +ClbStyleW@8 @3 +ClbWndProc@16 @4 +CustomControlInfoW@4 @5 + +; EOF diff --git a/reactos/subsys/system/regedit/clb/clb.rc b/reactos/subsys/system/regedit/clb/clb.rc new file mode 100644 index 00000000000..bf541e88779 --- /dev/null +++ b/reactos/subsys/system/regedit/clb/clb.rc @@ -0,0 +1,12 @@ +#include +#include +#include "resource.h" + +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Column List Box\0" +#define REACTOS_STR_INTERNAL_NAME "clb\0" +#define REACTOS_STR_ORIGINAL_FILENAME "clb.dll\0" +#include + +#include "clb_En.rc" + diff --git a/reactos/subsys/system/regedit/clb/clb.xml b/reactos/subsys/system/regedit/clb/clb.xml new file mode 100644 index 00000000000..5970a33ec1f --- /dev/null +++ b/reactos/subsys/system/regedit/clb/clb.xml @@ -0,0 +1,18 @@ + + + . + + + + 0x0500 + 0x0600 + 0x0600 + ntdll + kernel32 + user32 + gdi32 + comctl32 + clb.c + clb.rc + precomp.h + diff --git a/reactos/subsys/system/regedit/clb/clb_En.rc b/reactos/subsys/system/regedit/clb/clb_En.rc new file mode 100644 index 00000000000..a948666d848 --- /dev/null +++ b/reactos/subsys/system/regedit/clb/clb_En.rc @@ -0,0 +1,28 @@ +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT + +IDD_COLUMNLISTBOXSTYLES DIALOGEX 0, 0, 227, 215 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Column List Box Styles" +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + GROUPBOX "Column List Box Styles", -1, 6, 7, 158, 71 + CHECKBOX "&Standard", 1710, 10, 20, 42, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "&Border", 1713, 10, 30, 34, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "S&ort", 1705, 10, 40, 26, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Notif&y", 1706, 10, 50, 32, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "V&ert. Scroll Bar", 1707, 10, 60, 64, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "&Multiple Selection", -1, 79, 20, 72, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP | WS_DISABLED + CHECKBOX "E&xtended Selection", -1, 79, 30, 77, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP | WS_DISABLED + CHECKBOX "&Popout Headings", 1714, 79, 40, 68, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "&Springy Columns", 1715, 79, 50, 66, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + GROUPBOX "Basic Styles", -1, 6, 80, 158, 34 + CHECKBOX "&Visible", 1701, 10, 92, 34, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "&Disabled", 1702, 10, 102, 41, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "&Group", 1703, 79, 92, 32, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "&Tab Stop", 1704, 79, 102, 44, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON "OK", IDOK, 37, 125, 40, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Cancel", IDCANCEL, 93, 125, 40, 14, BS_PUSHBUTTON | WS_GROUP | WS_TABSTOP + CHECKBOX "&Disable No-Scroll", 1708, 79, 60, 66, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP +END + diff --git a/reactos/subsys/system/regedit/clb/clbdll.h b/reactos/subsys/system/regedit/clb/clbdll.h new file mode 100644 index 00000000000..bc148d18db1 --- /dev/null +++ b/reactos/subsys/system/regedit/clb/clbdll.h @@ -0,0 +1,43 @@ +#ifndef __CLBDLL_H +#define __CLBDLL_H + +#define CLBS_NOTIFY 0x1 +#define CLBS_SORT 0x2 +#define CLBS_DISABLENOSCROLL 0x1000 +#define CLBS_VSCROLL 0x200000 +#define CLBS_BORDER 0x800000 +#define CLBS_POPOUT_HEADINGS 0x200 +#define CLBS_SPRINGLY_COLUMNS 0x0 + +typedef struct _CLBS_INFO +{ + DWORD Style; + DWORD Unknown; /* FIXME - ExStyle??? */ + LPCWSTR StyleName; +} CLBS_INFO, *LPCLBS_INFO; + +typedef struct _CUSTOM_CONTROL_INFO +{ + WCHAR ClassName[32]; + DWORD Zero1; /* sizeof(DWORD) or sizeof(PVOID)? */ + WCHAR ClassName2[32]; + DWORD Unknown1; /* FIXME - size correct? */ + DWORD Unknown2; /* FIXME - size correct? */ + DWORD Unknown3; /* FIXME - size correct? */ + DWORD Zero2; /* FIXME - size correct? */ + DWORD Zero3; /* FIXME - size correct? */ + DWORD StylesCount; + const CLBS_INFO *SupportedStyles; + WCHAR Columns[256]; + INT_PTR (WINAPI *ClbStyleW)(IN HWND hWndParent, + IN LPARAM dwInitParam); + DWORD Zero4; /* FIXME - size correct? */ + DWORD Zero5; /* FIXME - size correct? */ + DWORD Zero6; /* FIXME - size correct? */ +} CUSTOM_CONTROL_INFO, *LPCUSTOM_CONTROL_INFO; + +LRESULT CALLBACK ClbWndProc(HWND,UINT,WPARAM,LPARAM); +INT_PTR WINAPI ClbStyleW(HWND,LPARAM); +BOOL WINAPI CustomControlInfoW(LPCUSTOM_CONTROL_INFO); + +#endif /* __CLBDLL_H */ diff --git a/reactos/subsys/system/regedit/clb/precomp.h b/reactos/subsys/system/regedit/clb/precomp.h new file mode 100644 index 00000000000..dd7b738aba0 --- /dev/null +++ b/reactos/subsys/system/regedit/clb/precomp.h @@ -0,0 +1,10 @@ +#include +#include +#include + +#include "resource.h" + +ULONG DbgPrint(PCH Format,...); +#define DPRINT1 DbgPrint + +/* EOF */ diff --git a/reactos/subsys/system/regedit/clb/resource.h b/reactos/subsys/system/regedit/clb/resource.h new file mode 100644 index 00000000000..f0d51c721f1 --- /dev/null +++ b/reactos/subsys/system/regedit/clb/resource.h @@ -0,0 +1,6 @@ +#ifndef __CLB_RESOURCE_H +#define __CLB_RESOURCE_H + +#define IDD_COLUMNLISTBOXSTYLES 1700 + +#endif /* __CLB_RESOURCE_H */ diff --git a/reactos/subsys/system/regedit/regedit.xml b/reactos/subsys/system/regedit/regedit.xml index ec3d2bd91d0..54e87f73752 100644 --- a/reactos/subsys/system/regedit/regedit.xml +++ b/reactos/subsys/system/regedit/regedit.xml @@ -26,3 +26,6 @@ treeview.c regedit.rc + + + \ No newline at end of file