[CMAKE]
[reactos.git] / base / applications / regedit / main.c
index b143aa7..0edfcec 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <regedit.h>
 
-BOOL ProcessCmdLine(LPSTR lpCmdLine);
+BOOL ProcessCmdLine(LPWSTR lpCmdLine);
 
 
 /*******************************************************************************
@@ -65,7 +65,6 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
     WNDCLASSEX wcFrame;
     WNDCLASSEX wcChild;
     ATOM hFrameWndClass;
-    ATOM hChildWndClass;
 
     ZeroMemory(&wcFrame, sizeof(WNDCLASSEX));
     wcFrame.cbSize = sizeof(WNDCLASSEX);
@@ -93,7 +92,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
     wcChild.hIconSm = (HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDI_REGEDIT), IMAGE_ICON,
                                               GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED);
 
-    hChildWndClass = RegisterClassEx(&wcChild); /* register child windows class */
+    RegisterClassEx(&wcChild); /* register child windows class */
 
     RegisterHexEditorClass(hInstance);
 
@@ -144,9 +143,8 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
     }
 
     /* Restore position */
-    if (RegQueryStringValue(HKEY_CURRENT_USER, g_szGeneralRegKey,
-        _T("LastKey"),
-        szBuffer, sizeof(szBuffer) / sizeof(szBuffer[0])) == ERROR_SUCCESS)
+    if (QueryStringValue(HKEY_CURRENT_USER, g_szGeneralRegKey, _T("LastKey"),
+        szBuffer, COUNT_OF(szBuffer)) == ERROR_SUCCESS)
     {
         SelectNode(g_pChildWnd->hTreeWnd, szBuffer);
     }
@@ -184,31 +182,16 @@ BOOL TranslateChildTabMessage(MSG *msg)
   return TRUE;
 }
 
-int APIENTRY WinMain(HINSTANCE hInstance,
-                     HINSTANCE hPrevInstance,
-                     LPSTR     lpCmdLine,
-                     int       nCmdShow)
+int APIENTRY wWinMain(HINSTANCE hInstance,
+                      HINSTANCE hPrevInstance,
+                      LPWSTR    lpCmdLine,
+                      int       nCmdShow)
 {
     MSG msg;
     HACCEL hAccel;
 
     UNREFERENCED_PARAMETER(hPrevInstance);
 
-    /*
-        int hCrt;
-        FILE *hf;
-        AllocConsole();
-        hCrt = _open_osfhandle((long)GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT);
-        hf = _fdopen(hCrt, "w");
-        *stdout = *hf;
-        setvbuf(stdout, NULL, _IONBF, 0);
-
-       wprintf(L"command line exit, hInstance = %d\n", hInstance);
-       getch();
-       FreeConsole();
-        return 0;
-     */
-
     if (ProcessCmdLine(lpCmdLine)) {
         return 0;
     }