regedit: Remove the printing code

André Hentschel nerv at dawncrow.de
Thu Sep 1 13:43:03 CDT 2011


It does nothing (except confusing)
beside that i doubt someone wants to print registry hives

---
 programs/regedit/En.rc      |    1 -
 programs/regedit/framewnd.c |   77 -------------------------------------------
 programs/regedit/regedit.rc |    3 --
 programs/regedit/resource.h |    3 --
 4 files changed, 0 insertions(+), 84 deletions(-)

diff --git a/programs/regedit/En.rc b/programs/regedit/En.rc
index 35411d2..512f528 100644
--- a/programs/regedit/En.rc
+++ b/programs/regedit/En.rc
@@ -162,7 +162,6 @@ END
 IDC_REGEDIT ACCELERATORS
 {
     "^F",	ID_EDIT_FIND
-    "^P",	ID_REGISTRY_PRINT
     VK_DELETE,	ID_EDIT_DELETE, VIRTKEY
     VK_F1,	ID_HELP_HELPTOPICS, VIRTKEY
     VK_F2,	ID_EDIT_RENAME, VIRTKEY
diff --git a/programs/regedit/framewnd.c b/programs/regedit/framewnd.c
index 0cdedec..0f8b485 100644
--- a/programs/regedit/framewnd.c
+++ b/programs/regedit/framewnd.c
@@ -392,71 +392,6 @@ static BOOL ExportRegistryFile(HWND hWnd)
     return TRUE;
 }
 
-static BOOL PrintRegistryHive(HWND hWnd, LPCWSTR path)
-{
-#if 1
-    PRINTDLGW pd;
-
-    ZeroMemory(&pd, sizeof(PRINTDLGW));
-    pd.lStructSize = sizeof(PRINTDLGW);
-    pd.hwndOwner   = hWnd;
-    pd.hDevMode    = NULL;     /* Don't forget to free or store hDevMode*/
-    pd.hDevNames   = NULL;     /* Don't forget to free or store hDevNames*/
-    pd.Flags       = PD_USEDEVMODECOPIESANDCOLLATE | PD_RETURNDC;
-    pd.nCopies     = 1;
-    pd.nFromPage   = 0xFFFF;
-    pd.nToPage     = 0xFFFF;
-    pd.nMinPage    = 1;
-    pd.nMaxPage    = 0xFFFF;
-    if (PrintDlgW(&pd)) {
-        /* GDI calls to render output. */
-        DeleteDC(pd.hDC); /* Delete DC when done.*/
-    }
-#else
-    HRESULT hResult;
-    PRINTDLGEXW pd;
-
-    hResult = PrintDlgExW(&pd);
-    if (hResult == S_OK) {
-        switch (pd.dwResultAction) {
-        case PD_RESULT_APPLY:
-            /*The user clicked the Apply button and later clicked the Cancel button. This indicates that the user wants to apply the changes made in the property sheet, but does not yet want to print. The PRINTDLGEX structure contains the information specified by the user at the time the Apply button was clicked. */
-            break;
-        case PD_RESULT_CANCEL:
-            /*The user clicked the Cancel button. The information in the PRINTDLGEX structure is unchanged. */
-            break;
-        case PD_RESULT_PRINT:
-            /*The user clicked the Print button. The PRINTDLGEX structure contains the information specified by the user. */
-            break;
-        default:
-            break;
-        }
-    } else {
-        switch (hResult) {
-        case E_OUTOFMEMORY:
-            /*Insufficient memory. */
-            break;
-        case E_INVALIDARG:
-            /* One or more arguments are invalid. */
-            break;
-        case E_POINTER:
-            /*Invalid pointer. */
-            break;
-        case E_HANDLE:
-            /*Invalid handle. */
-            break;
-        case E_FAIL:
-            /*Unspecified error. */
-            break;
-        default:
-            break;
-        }
-        return FALSE;
-    }
-#endif
-    return TRUE;
-}
-
 static BOOL CopyKeyName(HWND hWnd, LPCWSTR keyName)
 {
     BOOL result;
@@ -677,12 +612,6 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
     case ID_REGISTRY_EXPORTREGISTRYFILE:
         ExportRegistryFile(hWnd);
         break;
-    case ID_REGISTRY_PRINT:
-    {
-        const WCHAR empty = 0;
-        PrintRegistryHive(hWnd, &empty);
-        break;
-    }
     case ID_EDIT_DELETE:
     {
         HWND hWndDelete = GetFocus();
@@ -831,12 +760,6 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
         HeapFree(GetProcessHeap(), 0, keyPath);
     }
 	break;
-    case ID_REGISTRY_PRINTERSETUP:
-        /*PRINTDLG pd;*/
-        /*PrintDlg(&pd);*/
-        /*PAGESETUPDLG psd;*/
-        /*PageSetupDlg(&psd);*/
-        break;
     case ID_REGISTRY_OPENLOCAL:
         break;
     case ID_REGISTRY_EXIT:
diff --git a/programs/regedit/regedit.rc b/programs/regedit/regedit.rc
index 8d3b333..a5a1ad3 100644
--- a/programs/regedit/regedit.rc
+++ b/programs/regedit/regedit.rc
@@ -33,8 +33,6 @@ BEGIN
         MENUITEM "&Import Registry File...",    ID_REGISTRY_IMPORTREGISTRYFILE
         MENUITEM "&Export Registry File...",    ID_REGISTRY_EXPORTREGISTRYFILE
         MENUITEM SEPARATOR
-        MENUITEM "&Print...\tCtrl+P",           ID_REGISTRY_PRINT
-        MENUITEM SEPARATOR
         MENUITEM "E&xit",                       ID_REGISTRY_EXIT
     END
     POPUP "&Edit"
@@ -150,7 +148,6 @@ BEGIN
     ID_REGISTRY_IMPORTREGISTRYFILE "Imports a text file into the registry"
     ID_REGISTRY_EXPORTREGISTRYFILE
                             "Exports all or part of the registry to a text file"
-    ID_REGISTRY_PRINT       "Prints all or part of the registry"
 /*    ID_HELP_HELPTOPICS      "Opens registry editor help" */
     ID_HELP_ABOUT           "Displays program information, version number and copyright"
 END
diff --git a/programs/regedit/resource.h b/programs/regedit/resource.h
index 020765e..1d5934e 100644
--- a/programs/regedit/resource.h
+++ b/programs/regedit/resource.h
@@ -77,7 +77,6 @@
 #define ID_EDIT_NEW_DWORDVALUE          32788
 #define ID_REGISTRY_IMPORTREGISTRYFILE  32789
 #define ID_REGISTRY_EXPORTREGISTRYFILE  32790
-#define ID_REGISTRY_PRINT               32793
 #define ID_HELP_HELPTOPICS              32794
 #define ID_HELP_ABOUT                   32795
 #define ID_WINDOW_CASCADE               32797
@@ -113,8 +112,6 @@
 #define ID_REGISTRY_RESTORE             32829
 #define ID_REGISTRY_SAVEKEY             32830
 #define ID_REGISTRY_SELECTCOMPUTER      32831
-#define ID_REGISTRY_PRINTSUBTREE        32832
-#define ID_REGISTRY_PRINTERSETUP        32833
 #define ID_REGISTRY_SAVESUBTREEAS       32834
 #define IDS_LICENSE                     32835
 #define IDS_ERROR                       32836
-- 

Best Regards, André Hentschel



More information about the wine-patches mailing list