[RAPPS] move the message proc to gui.cpp
[reactos.git] / base / applications / rapps / gui.cpp
index ed2c3b8..f515143 100644 (file)
@@ -348,7 +348,7 @@ public:
             return FALSE;
         }
 
-        ImageList_Destroy((HIMAGELIST) SetImageList(hImageList));
+        ImageList_Destroy(SetImageList(hImageList));
 
         AddButtons(_countof(Buttons), Buttons);
 
@@ -802,6 +802,7 @@ private:
         AddCategory(hRootItemAvailable, IDS_CAT_TOOLS, IDI_CAT_TOOLS);
         AddCategory(hRootItemAvailable, IDS_CAT_DRIVERS, IDI_CAT_DRIVERS);
         AddCategory(hRootItemAvailable, IDS_CAT_LIBS, IDI_CAT_LIBS);
+        AddCategory(hRootItemAvailable, IDS_CAT_THEMES, IDI_CAT_THEMES);
         AddCategory(hRootItemAvailable, IDS_CAT_OTHER, IDI_CAT_OTHER);
 
         m_TreeView->SetImageList();
@@ -1136,6 +1137,10 @@ private:
                         UpdateApplicationsList(ENUM_CAT_VIDEO);
                         break;
 
+                    case IDS_CAT_THEMES:
+                        UpdateApplicationsList(ENUM_CAT_THEMES);
+                        break;
+
                     case IDS_SELECTEDFORINST:
                         UpdateApplicationsList(ENUM_CAT_SELECTED);
                         break;
@@ -1456,6 +1461,10 @@ private:
             PostMessageW(WM_CLOSE, 0, 0);
             break;
 
+        case ID_SEARCH:
+            ::SetFocus(m_SearchBar->m_hWnd);
+            break;
+
         case ID_INSTALL:
             if (IsAvailableEnum(SelectedEnumType))
             {
@@ -1463,6 +1472,7 @@ private:
                 {
                     CDownloadManager::DownloadListOfApplications(m_AvailableApps.GetSelected());
                     UpdateApplicationsList(-1);
+                    m_ListView->SetSelected(-1, FALSE);
                 }
                 else if (CDownloadManager::DownloadApplication(m_ListView->GetSelectedData()))
                 {
@@ -1819,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);
+            }
+        }
+    }    
+}