[RAPPS] move the message proc to gui.cpp
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Sun, 28 Apr 2019 03:10:45 +0000 (06:10 +0300)
committerMark Jansen <mark.jansen@reactos.org>
Mon, 19 Aug 2019 22:43:46 +0000 (00:43 +0200)
base/applications/rapps/gui.cpp
base/applications/rapps/include/dialogs.h
base/applications/rapps/winmain.cpp

index 852be19..f515143 100644 (file)
@@ -1829,3 +1829,31 @@ VOID InsertRichEditText(const ATL::CStringW& szText, DWORD flags)
 {
     InsertRichEditText(szText.GetString(), flags);
 }
+
+VOID ShowMainWindow(INT nShowCmd)
+{
+    HACCEL KeyBrd;
+    MSG Msg;
+
+    hMainWnd = CreateMainWindow();
+
+    if (hMainWnd)
+    {
+        /* Maximize it if we must */
+        ShowWindow(hMainWnd, ((SettingsInfo.bSaveWndPos && SettingsInfo.Maximized) ? SW_MAXIMIZE : nShowCmd));
+        UpdateWindow(hMainWnd);
+
+        /* Load the menu hotkeys */
+        KeyBrd = LoadAcceleratorsW(NULL, MAKEINTRESOURCEW(HOTKEYS));
+
+        /* Message Loop */
+        while (GetMessageW(&Msg, NULL, 0, 0))
+        {
+            if (!TranslateAcceleratorW(hMainWnd, KeyBrd, &Msg))
+            {
+                TranslateMessage(&Msg);
+                DispatchMessageW(&Msg);
+            }
+        }
+    }    
+}
index 69e0764..f05b223 100644 (file)
@@ -38,3 +38,5 @@ VOID CreateSettingsDlg(HWND hwnd);
 
 // About dialog (aboutdlg.cpp)
 VOID ShowAboutDialog();
+
+VOID ShowMainWindow(INT nShowCmd);
index 98f44a1..5660db8 100644 (file)
@@ -126,8 +126,6 @@ INT WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
 {
     LPCWSTR szWindowClass = L"ROSAPPMGR";
     HANDLE hMutex;
-    HACCEL KeyBrd;
-    MSG Msg;
     BOOL bIsFirstLaunch;
 
     InitializeAtlModule(hInstance, TRUE);
@@ -165,27 +163,7 @@ INT WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
         if (SettingsInfo.bUpdateAtStart || bIsFirstLaunch)
             CAvailableApps::ForceUpdateAppsDB();
 
-        hMainWnd = CreateMainWindow();
-
-        if (hMainWnd)
-        {
-            /* Maximize it if we must */
-            ShowWindow(hMainWnd, ((SettingsInfo.bSaveWndPos && SettingsInfo.Maximized) ? SW_MAXIMIZE : nShowCmd));
-            UpdateWindow(hMainWnd);
-
-            /* Load the menu hotkeys */
-            KeyBrd = LoadAcceleratorsW(NULL, MAKEINTRESOURCEW(HOTKEYS));
-
-            /* Message Loop */
-            while (GetMessageW(&Msg, NULL, 0, 0))
-            {
-                if (!TranslateAcceleratorW(hMainWnd, KeyBrd, &Msg))
-                {
-                    TranslateMessage(&Msg);
-                    DispatchMessageW(&Msg);
-                }
-            }
-        }
+        ShowMainWindow(nShowCmd);
     }
 
     if (hMutex)