revert prev commit
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Wed, 12 Jul 2006 12:36:31 +0000 (12:36 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Wed, 12 Jul 2006 12:36:31 +0000 (12:36 +0000)
svn path=/trunk/; revision=23023

reactos/base/applications/regedit/clb/clb.c [new file with mode: 0644]
reactos/base/applications/regedit/clb/clb.def [new file with mode: 0644]
reactos/base/applications/regedit/clb/clb.rbuild [new file with mode: 0644]
reactos/base/applications/regedit/clb/clb.rc [new file with mode: 0644]
reactos/base/applications/regedit/clb/clb_En.rc [new file with mode: 0644]
reactos/base/applications/regedit/clb/clb_Ja.rc [new file with mode: 0644]
reactos/base/applications/regedit/clb/clbdll.h [new file with mode: 0644]
reactos/base/applications/regedit/clb/precomp.h [new file with mode: 0644]
reactos/base/applications/regedit/clb/resource.h [new file with mode: 0644]
reactos/base/applications/regedit/regedit.rbuild

diff --git a/reactos/base/applications/regedit/clb/clb.c b/reactos/base/applications/regedit/clb/clb.c
new file mode 100644 (file)
index 0000000..fe5010a
--- /dev/null
@@ -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 <w3seek@reactos.com>
+ *
+ * UPDATE HISTORY:
+ *      10/29/2005  Created
+ */
+#include <precomp.h>
+
+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/base/applications/regedit/clb/clb.def b/reactos/base/applications/regedit/clb/clb.def
new file mode 100644 (file)
index 0000000..9762bd1
--- /dev/null
@@ -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/base/applications/regedit/clb/clb.rbuild b/reactos/base/applications/regedit/clb/clb.rbuild
new file mode 100644 (file)
index 0000000..5970a33
--- /dev/null
@@ -0,0 +1,18 @@
+<module name="clb" type="win32dll" baseaddress="${BASEADDRESS_CLB}" installbase="system32" installname="clb.dll">
+       <importlibrary definition="clb.def" />
+       <include base="clb">.</include>
+       <define name="UNICODE" />
+       <define name="_UNICODE" />
+       <define name="__USE_W32API" />
+       <define name="_WIN32_IE">0x0500</define>
+       <define name="_WIN32_WINNT">0x0600</define>
+       <define name="WINVER">0x0600</define>
+       <library>ntdll</library>
+       <library>kernel32</library>
+       <library>user32</library>
+       <library>gdi32</library>
+       <library>comctl32</library>
+       <file>clb.c</file>
+       <file>clb.rc</file>
+       <pch>precomp.h</pch>
+</module>
diff --git a/reactos/base/applications/regedit/clb/clb.rc b/reactos/base/applications/regedit/clb/clb.rc
new file mode 100644 (file)
index 0000000..ac5884f
--- /dev/null
@@ -0,0 +1,12 @@
+#include <windows.h>
+#include <reactos/resource.h>
+#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 <reactos/version.rc>
+
+#include "clb_En.rc"
+#include "clb_Ja.rc"
diff --git a/reactos/base/applications/regedit/clb/clb_En.rc b/reactos/base/applications/regedit/clb/clb_En.rc
new file mode 100644 (file)
index 0000000..ac8fcbf
--- /dev/null
@@ -0,0 +1,28 @@
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+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/base/applications/regedit/clb/clb_Ja.rc b/reactos/base/applications/regedit/clb/clb_Ja.rc
new file mode 100644 (file)
index 0000000..8672981
--- /dev/null
@@ -0,0 +1,27 @@
+LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
+
+IDD_COLUMNLISTBOXSTYLES DIALOGEX 0, 0, 227, 215
+STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "\97ñ\83\8a\83X\83\83{\83b\83N\83X\82Ì\8c`\8e®"
+FONT 9, "MS UI Gothic", 0, 0, 0x0
+BEGIN
+   GROUPBOX "\97ñ\83\8a\83X\83\83{\83b\83N\83X\82Ì\8c`\8e®", -1, 6, 7, 158, 71
+   CHECKBOX "\95W\8f\80(&S)", 1710, 10, 20, 42, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+   CHECKBOX "\8b«\8aE\90ü(&B)", 1713, 10, 30, 34, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+   CHECKBOX "\95À\82×\91Ö\82¦(&O)", 1705, 10, 40, 26, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+   CHECKBOX "\92Ê\92m(&Y)", 1706, 10, 50, 32, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+   CHECKBOX "\90\82\92¼\83X\83N\83\8d\81[\83\8b \83o\81[(&E)", 1707, 10, 60, 64, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+   CHECKBOX "\95¡\90\94\91I\91ð(&M)", -1, 79, 20, 72, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP | WS_DISABLED
+   CHECKBOX "\8ag\92£\91I\91ð(&X)", -1, 79, 30, 77, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP | WS_DISABLED
+   CHECKBOX "\83|\83b\83v\83A\83E\83g\8c©\8fo\82µ(&P)", 1714, 79, 40, 68, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+   CHECKBOX "\83o\83l\8e®\82Ì\97ñ(&S)", 1715, 79, 50, 66, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+   GROUPBOX "\8aî\96{\8c`\8e®", -1, 6, 80, 158, 34
+   CHECKBOX "\89Â\8e\8b(&V)", 1701, 10, 92, 34, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+   CHECKBOX "\96³\8cø(&D)", 1702, 10, 102, 41, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+   CHECKBOX "\83O\83\8b\81[\83v(&G)", 1703, 79, 92, 32, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+   CHECKBOX "\83^\83u\95\9d(&T)", 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 "\83L\83\83\83\93\83Z\83\8b", IDCANCEL, 93, 125, 40, 14, BS_PUSHBUTTON | WS_GROUP | WS_TABSTOP
+   CHECKBOX "\94ñ\83X\83N\83\8d\81[\83\8b\82Ì\96³\8cø(&D)", 1708, 79, 60, 66, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+END
+
diff --git a/reactos/base/applications/regedit/clb/clbdll.h b/reactos/base/applications/regedit/clb/clbdll.h
new file mode 100644 (file)
index 0000000..bc148d1
--- /dev/null
@@ -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/base/applications/regedit/clb/precomp.h b/reactos/base/applications/regedit/clb/precomp.h
new file mode 100644 (file)
index 0000000..dd7b738
--- /dev/null
@@ -0,0 +1,10 @@
+#include <windows.h>
+#include <commctrl.h>
+#include <clbdll.h>
+
+#include "resource.h"
+
+ULONG DbgPrint(PCH Format,...);
+#define DPRINT1 DbgPrint
+
+/* EOF */
diff --git a/reactos/base/applications/regedit/clb/resource.h b/reactos/base/applications/regedit/clb/resource.h
new file mode 100644 (file)
index 0000000..f0d51c7
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __CLB_RESOURCE_H
+#define __CLB_RESOURCE_H
+
+#define IDD_COLUMNLISTBOXSTYLES 1700
+
+#endif /* __CLB_RESOURCE_H */
index 60c0f02..50141a1 100644 (file)
@@ -31,3 +31,6 @@
        <file>regedit.rc</file>
        <pch>regedit.h</pch>
 </module>
+<directory name="clb">
+       <xi:include href="clb/clb.rbuild" />
+</directory>
\ No newline at end of file