ReactOS  0.4.15-dev-1397-g19779b3
gui.cpp
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Applications Manager
3  * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE: GUI classes for RAPPS
5  * COPYRIGHT: Copyright 2015 David Quintana (gigaherz@gmail.com)
6  * Copyright 2017 Alexander Shaposhnikov (sanchaez@reactos.org)
7  * Copyright 2020 He Yang (1160386205@qq.com)
8  */
9 
10 #include "rapps.h"
11 #include "rosui.h"
12 #include "crichedit.h"
13 #include "appview.h"
14 #include "asyncinet.h"
15 #include "misc.h"
16 #include "gui.h"
17 #include "appview.h"
18 #include "winmain.h"
19 #include <shlobj_undoc.h>
20 #include <shlguid_undoc.h>
21 
22 #include <atlbase.h>
23 #include <atlcom.h>
24 #include <atltypes.h>
25 #include <atlwin.h>
26 #include <wininet.h>
27 #include <shellutils.h>
28 #include <rosctrls.h>
29 #include <gdiplus.h>
30 #include <math.h>
31 
32 #define SEARCH_TIMER_ID 'SR'
33 #define TREEVIEW_ICON_SIZE 24
34 
35 
36 
37 // **** CSideTreeView ****
38 
40  CUiWindow(),
43  0, 1))
44 {
45 }
46 
48 {
49  return CUiWindow<CTreeView>::AddItem(hParent, const_cast<LPWSTR>(Text.GetString()), Image, SelectedImage, lParam);
50 }
51 
53 {
55  INT Index = 0;
56  HICON hIcon;
57 
60  IMAGE_ICON,
64  if (hIcon)
65  {
68  }
69 
70  szText.LoadStringW(TextIndex);
71  return AddItem(hRootItem, szText, Index, Index, TextIndex);
72 }
73 
75 {
77 }
78 
80 {
81  if (hImageTreeView)
83 }
84 
86 {
88 }
89 // **** CSideTreeView ****
90 
91 
92 
93 // **** CMainWindow ****
94 
96  m_ClientPanel(NULL),
97  SelectedEnumType(ENUM_ALL_INSTALLED)
98 {
99 }
100 
102 {
103  LayoutCleanup();
104 }
105 
107 {
108  HTREEITEM hRootItemInstalled, hRootItemAvailable;
109 
110  hRootItemInstalled = m_TreeView->AddCategory(TVI_ROOT, IDS_INSTALLED, IDI_CATEGORY);
111  m_TreeView->AddCategory(hRootItemInstalled, IDS_APPLICATIONS, IDI_APPS);
112  m_TreeView->AddCategory(hRootItemInstalled, IDS_UPDATES, IDI_APPUPD);
113 
115 
117  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_AUDIO, IDI_CAT_AUDIO);
118  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_VIDEO, IDI_CAT_VIDEO);
120  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_GAMES, IDI_CAT_GAMES);
122  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_OFFICE, IDI_CAT_OFFICE);
123  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_DEVEL, IDI_CAT_DEVEL);
124  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_EDU, IDI_CAT_EDU);
126  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_FINANCE, IDI_CAT_FINANCE);
127  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_SCIENCE, IDI_CAT_SCIENCE);
128  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_TOOLS, IDI_CAT_TOOLS);
129  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_DRIVERS, IDI_CAT_DRIVERS);
130  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_LIBS, IDI_CAT_LIBS);
131  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_THEMES, IDI_CAT_THEMES);
132  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_OTHER, IDI_CAT_OTHER);
133 
135  m_TreeView->Expand(hRootItemInstalled, TVE_EXPAND);
136  m_TreeView->Expand(hRootItemAvailable, TVE_EXPAND);
137  m_TreeView->SelectItem(hRootItemAvailable);
138 }
139 
141 {
146 
148 }
149 
151 {
152  m_TreeView = new CSideTreeView();
156 
157  return m_TreeView->Create(m_hWnd) != NULL;
158 }
159 
161 {
162  m_ApplicationView = new CApplicationView(this); // pass this to ApplicationView for callback purpose
166 
167  return m_ApplicationView->Create(m_hWnd) != NULL;
168 }
169 
171 {
172  m_VSplitter = new CUiSplitPanel();
177  m_VSplitter->m_MinFirst = 0;
178 
179  // TODO: m_MinSecond should be calculate dynamically instead of hard-coded
180  m_VSplitter->m_MinSecond = 480;
181  m_VSplitter->m_Pos = 240;
183 
184  return m_VSplitter->Create(m_hWnd) != NULL;
185 }
186 
188 {
189  BOOL b = TRUE;
190  bUpdating = TRUE;
191 
192  m_ClientPanel = new CUiPanel();
195 
196  // Top level
197  b = b && CreateStatusBar();
198  b = b && CreateVSplitter();
199 
200  // Inside V Splitter
201  b = b && CreateTreeView();
202  b = b && CreateApplicationView();
203 
204  if (b)
205  {
206  RECT rBottom;
207 
208  /* Size status bar */
209  m_StatusBar->SendMessageW(WM_SIZE, 0, 0);
210 
211  ::GetWindowRect(m_StatusBar->m_hWnd, &rBottom);
212 
213  m_VSplitter->m_Margin.bottom = rBottom.bottom - rBottom.top;
214  }
215 
216  bUpdating = FALSE;
217  return b;
218 }
219 
221 {
222  delete m_TreeView;
223  delete m_ApplicationView;
224  delete m_VSplitter;
225  delete m_StatusBar;
226  return;
227 }
228 
230 {
231  if (CreateLayout())
232  {
234 
236 
237  return TRUE;
238  }
239 
240  return FALSE;
241 }
242 
244 {
245  if (wParam == SIZE_MINIMIZED)
246  return;
247 
248  /* Size status bar */
249  m_StatusBar->SendMessage(WM_SIZE, 0, 0);
250 
251 
252  RECT r = { 0, 0, LOWORD(lParam), HIWORD(lParam) };
253  HDWP hdwp = NULL;
255 
256  hdwp = BeginDeferWindowPos(count);
257  if (hdwp)
258  {
259  hdwp = m_ClientPanel->OnParentSize(r, hdwp);
260  if (hdwp)
261  {
262  EndDeferWindowPos(hdwp);
263  }
264  }
265 }
266 
268 {
270  return FALSE;
271 
272  ATL::CStringW szMsgText, szMsgTitle;
273 
274  if (!szMsgText.LoadStringW(IDS_APP_REG_REMOVE) ||
275  !szMsgTitle.LoadStringW(IDS_INFORMATION))
276  return FALSE;
277 
278  if (MessageBoxW(szMsgText, szMsgTitle, MB_YESNO | MB_ICONQUESTION) == IDYES)
279  {
281  if (!InstalledApp)
282  return FALSE;
283 
284  LSTATUS Result = InstalledApp->RemoveFromRegistry();
285  if (Result != ERROR_SUCCESS)
286  {
287  // TODO: popup a messagebox telling user it fails somehow
288  return FALSE;
289  }
290 
291  // as it's already removed form registry, this will also remove it from the list
293  return TRUE;
294  }
295 
296  return FALSE;
297 }
298 
300 {
302  return FALSE;
303 
305  if (!InstalledApp)
306  return FALSE;
307 
308  return InstalledApp->UninstallApplication(bModify);
309 }
310 
312 {
313  theResult = 0;
314  switch (Msg)
315  {
316  case WM_CREATE:
317  if (!InitControls())
318  ::PostMessageW(hwnd, WM_CLOSE, 0, 0);
319  break;
320 
321  case WM_DESTROY:
322  {
325 
326  FreeLogs();
329 
330  delete m_ClientPanel;
331 
332  PostQuitMessage(0);
333  return 0;
334  }
335 
336  case WM_COMMAND:
338  break;
339 
340  case WM_NOTIFY:
341  {
343 
344  switch (data->code)
345  {
346  case TVN_SELCHANGED:
347  {
348  if (data->hwndFrom == m_TreeView->m_hWnd)
349  {
350  switch (((LPNMTREEVIEW)lParam)->itemNew.lParam)
351  {
352  case IDS_INSTALLED:
354  break;
355 
356  case IDS_APPLICATIONS:
358  break;
359 
360  case IDS_UPDATES:
362  break;
363 
366  break;
367 
368  case IDS_CAT_AUDIO:
370  break;
371 
372  case IDS_CAT_DEVEL:
374  break;
375 
376  case IDS_CAT_DRIVERS:
378  break;
379 
380  case IDS_CAT_EDU:
382  break;
383 
384  case IDS_CAT_ENGINEER:
386  break;
387 
388  case IDS_CAT_FINANCE:
390  break;
391 
392  case IDS_CAT_GAMES:
394  break;
395 
396  case IDS_CAT_GRAPHICS:
398  break;
399 
400  case IDS_CAT_INTERNET:
402  break;
403 
404  case IDS_CAT_LIBS:
406  break;
407 
408  case IDS_CAT_OFFICE:
410  break;
411 
412  case IDS_CAT_OTHER:
414  break;
415 
416  case IDS_CAT_SCIENCE:
418  break;
419 
420  case IDS_CAT_TOOLS:
422  break;
423 
424  case IDS_CAT_VIDEO:
426  break;
427 
428  case IDS_CAT_THEMES:
430  break;
431 
432  case IDS_SELECTEDFORINST:
434  break;
435  }
436  }
437 
438  HMENU mainMenu = ::GetMenu(hwnd);
439 
440  /* Disable/enable items based on treeview selection */
442  {
444  EnableMenuItem(mainMenu, ID_INSTALL, MF_GRAYED);
446  EnableMenuItem(mainMenu, ID_MODIFY, MF_ENABLED);
447  }
448  else
449  {
453  EnableMenuItem(mainMenu, ID_MODIFY, MF_GRAYED);
454  }
455  }
456  break;
457 
458  }
459  }
460  break;
461 
462  case WM_SIZE:
464  break;
465 
466  case WM_SIZING:
467  {
468  LPRECT pRect = (LPRECT)lParam;
469 
470  if (pRect->right - pRect->left < 565)
471  pRect->right = pRect->left + 565;
472 
473  if (pRect->bottom - pRect->top < 300)
474  pRect->bottom = pRect->top + 300;
475 
476  return TRUE;
477  }
478 
479  case WM_SYSCOLORCHANGE:
480  {
481  /* Forward WM_SYSCOLORCHANGE to common controls */
483  m_TreeView->SendMessageW(WM_SYSCOLORCHANGE, wParam, lParam);
484  }
485  break;
486 
487  case WM_TIMER:
488  if (wParam == SEARCH_TIMER_ID)
489  {
491 
493  }
494  break;
495  }
496 
497  return FALSE;
498 }
499 
501 {
502  HTREEITEM hSelectedItem = m_TreeView->GetSelection();
503  TV_ITEM tItem;
504 
505  tItem.mask = TVIF_PARAM | TVIF_HANDLE;
506  tItem.hItem = hSelectedItem;
507  m_TreeView->GetItem(&tItem);
508  switch (tItem.lParam)
509  {
510  case IDS_INSTALLED:
511  case IDS_APPLICATIONS:
512  case IDS_UPDATES:
513  return TRUE;
514  default:
515  return FALSE;
516  }
517 }
518 
520 {
521  ATL::CStringW szApp;
522  ATL::CStringW szAuthors;
523  HICON hIcon;
524 
525  szApp.LoadStringW(IDS_APPTITLE);
526  szAuthors.LoadStringW(IDS_APP_AUTHORS);
528  ShellAboutW(m_hWnd, szApp, szAuthors, hIcon);
530 }
531 
533 {
534  WORD wCommand = LOWORD(wParam);
535 
536  if (!lParam)
537  {
538  switch (wCommand)
539  {
540  case ID_SETTINGS:
542  break;
543 
544  case ID_EXIT:
545  PostMessageW(WM_CLOSE, 0, 0);
546  break;
547 
548  case ID_INSTALL:
550  {
552 
553  // enum all selected apps
555 
556  if (AppsList.GetSize())
557  {
558  if (DownloadListOfApplications(AppsList, FALSE))
559  {
562  }
563  }
564  else
565  {
566  // use the currently focused item in application-view
568  if (FocusedApps)
569  {
570  if (DownloadApplication(FocusedApps, FALSE))
571  {
573  }
574  }
575  else
576  {
577  // TODO: in this case, Install button in toolbar (and all other places) should be disabled
578  // or at least popup a messagebox telling user to select/check some app first
579  }
580  }
581  }
582  break;
583 
584  case ID_UNINSTALL:
587  break;
588 
589  case ID_MODIFY:
592  break;
593 
594  case ID_REGREMOVE:
596  break;
597 
598  case ID_REFRESH:
600  break;
601 
602  case ID_RESETDB:
605  break;
606 
607  case ID_HELP:
608  MessageBoxW(L"Help not implemented yet", NULL, MB_OK);
609  break;
610 
611  case ID_ABOUT:
612  ShowAboutDlg();
613  break;
614 
615  case ID_CHECK_ALL:
617  break;
618  }
619  }
620 }
621 
623 {
624  if (!SearchPatternMatch(Info->szDisplayName.GetString(), szSearchPattern))
625  {
626  return TRUE;
627  }
628  return m_ApplicationView->AddInstalledApplication(Info, Info); // currently, the callback param is Info itself
629 }
630 
632 {
633  if (!SearchPatternMatch(Info->m_szName.GetString(), szSearchPattern) &&
634  !SearchPatternMatch(Info->m_szDesc.GetString(), szSearchPattern))
635  {
636  return TRUE;
637  }
638  return m_ApplicationView->AddAvailableApplication(Info, bInitialCheckState, Info); // currently, the callback param is Info itself
639 }
640 
642 {
643  CMainWindow *pThis = (CMainWindow *)param;
644  return pThis->EnumInstalledAppProc(Info);
645 }
646 
648 {
649  CMainWindow *pThis = (CMainWindow *)param;
650  return pThis->EnumAvailableAppProc(Info, bInitialCheckState);
651 }
652 
654 {
656  pAppList->Add(*Info);
657  return TRUE;
658 }
659 
661 {
662  if (m_StatusBar)
663  {
664  ATL::CStringW szBuffer;
665 
667  m_StatusBar->SetText(szBuffer);
668  }
669 }
670 
672 {
673  bUpdating = TRUE;
674 
675  if (EnumType == -1)
676  {
677  // keep the old enum type
678  EnumType = SelectedEnumType;
679  }
680  else
681  {
682  SelectedEnumType = EnumType;
683  }
684 
685  m_ApplicationView->SetRedraw(FALSE);
686  if (IsInstalledEnum(EnumType))
687  {
688  // set the display type of application-view. this will remove all the item in application-view too.
690 
691  // enum installed softwares
693  }
694  else if (IsAvailableEnum(EnumType))
695  {
696  // set the display type of application-view. this will remove all the item in application-view too.
698 
699  // enum available softwares
701  }
702  m_ApplicationView->SetRedraw(TRUE);
703  m_ApplicationView->RedrawWindow(0, 0, RDW_INVALIDATE | RDW_ALLCHILDREN); // force the child window to repaint
705  bUpdating = FALSE;
706 }
707 
709 {
710  DWORD csStyle = CS_VREDRAW | CS_HREDRAW;
711  static ATL::CWndClassInfo wc =
712  {
713  {
714  sizeof(WNDCLASSEX),
715  csStyle,
717  0,
718  0,
719  NULL,
720  LoadIconW(_AtlBaseModule.GetModuleInstance(), MAKEINTRESOURCEW(IDI_MAIN)),
722  (HBRUSH)(COLOR_BTNFACE + 1),
725  NULL
726  },
727  NULL, NULL, IDC_ARROW, TRUE, 0, _T("")
728  };
729  return wc;
730 }
731 
733 {
734  ATL::CStringW szWindowName;
735  szWindowName.LoadStringW(IDS_APPTITLE);
736 
737  RECT r = {
742  };
743  r.right += r.left;
744  r.bottom += r.top;
745 
747 }
748 
749 // this function is called when a item of application-view is checked/unchecked
750 // CallbackParam is the param passed to application-view when adding the item (the one getting focus now).
752 {
753  if (!bUpdating)
754  {
755  if (bChecked)
756  {
758  {
759  return FALSE;
760  }
761  }
762  else
763  {
765  {
766  return FALSE;
767  }
768  }
769 
771  return TRUE;
772  }
773  else
774  {
775  return TRUE;
776  }
777 }
778 
779 // this function is called when one or more application(s) should be installed install
780 // if Info is not zero, this app should be installed. otherwise those checked apps should be installed
782 {
783  if (Info)
784  {
786  {
788  return TRUE;
789  }
790  }
791  else
792  {
794 
795  // enum all selected apps
797 
798  if (AppsList.GetSize())
799  {
800  if (DownloadListOfApplications(AppsList, FALSE))
801  {
804  return TRUE;
805  }
806  }
807  }
808 
809  return FALSE;
810 }
811 
813 {
814  if (szSearchPattern == SearchText)
815  {
816  return FALSE;
817  }
818 
819  szSearchPattern = SearchText;
820 
821  DWORD dwDelay;
822  SystemParametersInfoW(SPI_GETMENUSHOWDELAY, 0, &dwDelay, 0);
823  SetTimer(SEARCH_TIMER_ID, dwDelay);
824 
825  return TRUE;
826 }
827 
828 void CMainWindow::HandleTabOrder(int direction)
829 {
830  ATL::CSimpleArray<HWND> TabOrderHwndList;
831 
832  m_TreeView->AppendTabOrderWindow(direction, TabOrderHwndList);
833  m_ApplicationView->AppendTabOrderWindow(direction, TabOrderHwndList);
834 
835 
836  if (TabOrderHwndList.GetSize() == 0)
837  {
838  // in case the list is empty
839  return;
840  }
841 
842  int FocusIndex;
843 
844  if ((FocusIndex = TabOrderHwndList.Find(GetFocus())) == -1)
845  {
846  FocusIndex = 0; // focus the first window in the list
847  }
848  else
849  {
850  FocusIndex += direction;
851  FocusIndex += TabOrderHwndList.GetSize(); // FocusIndex might be negative. we don't want to mod a negative number
852  FocusIndex %= TabOrderHwndList.GetSize();
853  }
854 
855  ::SetFocus(TabOrderHwndList[FocusIndex]);
856  return;
857 }
858 // **** CMainWindow ****
859 
860 
861 
863 {
864  HACCEL KeyBrd;
865  MSG Msg;
866 
867  CMainWindow* wnd = new CMainWindow();
868  if (!wnd)
869  return;
870 
871  hMainWnd = wnd->Create();
872  if (!hMainWnd)
873  return;
874 
875  /* Maximize it if we must */
877  wnd->UpdateWindow();
878 
879  /* Load the menu hotkeys */
881 
882  /* Message Loop */
883  while (GetMessageW(&Msg, NULL, 0, 0))
884  {
885  if (!TranslateAcceleratorW(hMainWnd, KeyBrd, &Msg))
886  {
887  if (Msg.message == WM_CHAR &&
888  Msg.wParam == VK_TAB)
889  {
890  // Move backwards if shift is held down
891  int direction = (GetKeyState(VK_SHIFT) & 0x8000) ? -1 : 1;
892 
893  wnd->HandleTabOrder(direction);
894  continue;
895  }
896 
899  }
900  }
901 
902  delete wnd;
903 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
CUiSplitPanel * m_VSplitter
Definition: gui.h:50
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define IDR_MAINMENU
Definition: resource.h:40
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1608
BOOL WINAPI TranslateMessage(_In_ const MSG *)
static HICON
Definition: imagelist.c:84
HDWP WINAPI BeginDeferWindowPos(_In_ int)
BOOL AddAvailableApplication(CAvailableApplicationInfo *AvlbAppInfo, BOOL InitCheckState, LPVOID param)
Definition: appview.cpp:1989
HWND SetFocus()
Definition: atlwin.h:1130
#define ID_REFRESH
Definition: resource.h:16
#define IMAGE_ICON
Definition: winuser.h:212
#define IDC_STATUSBAR
Definition: resource.h:12
BOOL RemoveSelectedAppFromRegistry()
Definition: gui.cpp:267
#define ID_SETTINGS
Definition: resource.h:81
BOOL InitControls()
Definition: gui.cpp:229
BOOL Add(const T &t)
Definition: atlsimpcoll.h:58
ATL::CStringW szSearchPattern
Definition: gui.h:62
CUiCollection & Second()
Definition: rosui.h:568
BOOL AddInstalledApplication(CInstalledApplicationInfo *InstAppInfo, LPVOID param)
Definition: appview.cpp:1980
#define ERROR_SUCCESS
Definition: deptool.c:10
#define WM_CHAR
Definition: winuser.h:1699
#define IDYES
Definition: winuser.h:829
#define ID_REGREMOVE
Definition: resource.h:83
#define IDS_APPTITLE
Definition: resource.h:3
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
BOOL CreateStatusBar()
Definition: gui.cpp:140
#define TRUE
Definition: types.h:120
#define SW_HIDE
Definition: winuser.h:762
#define IDS_CAT_DEVEL
Definition: resource.h:177
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
_In_ BOOLEAN Create
Definition: pstypes.h:519
#define IDS_APPS_COUNT
Definition: resource.h:95
BOOL bUpdating
Definition: gui.h:60
CInstalledApps m_InstalledApps
Definition: gui.h:58
GLuint GLuint GLsizei count
Definition: gl.h:1545
VOID RemoveAllSelected()
Definition: available.cpp:562
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
BOOL CreateTreeView()
Definition: gui.cpp:150
INT m_MinFirst
Definition: rosui.h:544
#define CALLBACK
Definition: compat.h:35
LONG top
Definition: windef.h:307
#define LPNMTREEVIEW
Definition: commctrl.h:3639
~CSideTreeView()
Definition: gui.cpp:85
HTREEITEM AddCategory(HTREEITEM hRootItem, UINT TextIndex, UINT IconIndex)
Definition: gui.cpp:52
#define IDS_CAT_OFFICE
Definition: resource.h:186
#define CS_HREDRAW
Definition: winuser.h:648
static BOOL CALLBACK s_EnumSelectedAppForDownloadProc(CAvailableApplicationInfo *Info, BOOL bInitialCheckState, PVOID param)
Definition: gui.cpp:653
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:716
#define IDI_CAT_DEVEL
Definition: resource.h:21
#define IDI_CATEGORY
Definition: resource.h:13
UINT_PTR WPARAM
Definition: windef.h:207
#define VK_TAB
Definition: winuser.h:2174
#define ID_RESETDB
Definition: resource.h:84
INT SelectedEnumType
Definition: gui.h:63
LONG left
Definition: windef.h:306
#define IDS_CAT_VIDEO
Definition: resource.h:190
#define WS_CLIPCHILDREN
Definition: pedump.c:619
CSideTreeView()
Definition: gui.cpp:39
VOID FreeLogs()
Definition: misc.cpp:241
LONG right
Definition: windef.h:308
BOOL Maximized
Definition: settings.h:13
int GetSize() const
Definition: atlsimpcoll.h:104
#define IDS_CAT_FINANCE
Definition: resource.h:181
#define ID_UNINSTALL
Definition: resource.h:75
int32_t INT
Definition: typedefs.h:58
VOID AppendTabOrderWindow(int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
Definition: appview.cpp:2014
WPARAM wParam
Definition: combotst.c:138
#define IDS_AVAILABLEFORINST
Definition: resource.h:100
struct tagNMHDR * LPNMHDR
VOID FreeCachedEntries()
Definition: installed.cpp:325
BOOL CALLBACK EnumInstalledAppProc(CInstalledApplicationInfo *Info)
Definition: gui.cpp:622
BOOL SearchPatternMatch(LPCWSTR szHaystack, LPCWSTR szNeedle)
Definition: misc.cpp:526
#define IDS_INSTALLED
Definition: resource.h:99
BOOL SetDisplayAppType(APPLICATION_VIEW_TYPE AppType)
Definition: appview.cpp:1926
BOOL ProcessWindowMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId)
Definition: gui.cpp:311
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
BOOL IsSelectedNodeInstalled()
Definition: gui.cpp:500
#define IDI_CAT_ENGINEER
Definition: resource.h:24
virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
Definition: rosui.h:421
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
VOID MainWindowLoop(INT nShowCmd)
Definition: gui.cpp:862
HWND Create(HWND hwndParent)
Definition: appview.cpp:1917
void SaveSettings(void)
Definition: settings.c:115
const TCHAR szWindowClass[]
Definition: magnifier.c:28
struct @1620 Msg[]
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
INT Append(T *ptr)
Definition: rosui.h:79
#define IDI_CAT_OFFICE
Definition: resource.h:30
#define FALSE
Definition: types.h:117
#define MB_YESNO
Definition: winuser.h:811
static const WCHAR szText[]
Definition: dialog.c:139
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define IDI_CAT_VIDEO
Definition: resource.h:34
unsigned int BOOL
Definition: ntddk_ex.h:94
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
HIMAGELIST hImageTreeView
Definition: gui.h:30
UINT_PTR SetTimer(UINT_PTR nIDEvent, UINT nElapse, void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD)=NULL)
Definition: atlwin.h:1190
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
HTREEITEM AddItem(HTREEITEM hParent, ATL::CStringW &Text, INT Image, INT SelectedImage, LPARAM lParam)
Definition: gui.cpp:47
BOOL Expand(HTREEITEM item, DWORD action)
Definition: rosctrls.h:597
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:242
#define CW_USEDEFAULT
Definition: winuser.h:225
BOOL KillTimer(UINT_PTR nIDEvent)
Definition: atlwin.h:908
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:764
VOID FreeCachedEntries()
Definition: available.cpp:345
#define VK_SHIFT
Definition: winuser.h:2177
#define WM_SIZING
Definition: winuser.h:1789
HACCEL WINAPI LoadAcceleratorsW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
static BOOL CALLBACK s_EnumAvailableAppProc(CAvailableApplicationInfo *Info, BOOL bInitialCheckState, PVOID param)
Definition: gui.cpp:647
#define MB_ICONQUESTION
Definition: winuser.h:783
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
LONG_PTR LPARAM
Definition: windef.h:208
#define LPRECT
Definition: precomp.h:28
#define IDS_SELECTEDFORINST
Definition: resource.h:119
BOOL IsAvailableEnum(INT x)
Definition: defines.h:66
#define ID_ABOUT
Definition: charmap.c:18
#define IDS_CAT_INTERNET
Definition: resource.h:184
INT m_MinSecond
Definition: rosui.h:545
BOOL CALLBACK EnumAvailableAppProc(CAvailableApplicationInfo *Info, BOOL bInitialCheckState)
Definition: gui.cpp:631
HIMAGELIST SetImageList()
Definition: gui.cpp:74
#define b
Definition: ke_i.h:79
BOOL Enum(INT EnumType, APPENUMPROC lpEnumProc, PVOID param)
Definition: installed.cpp:174
BOOL InstallApplication(CAvailableApplicationInfo *Info)
Definition: gui.cpp:781
#define WM_DESTROY
Definition: winuser.h:1591
#define IDS_CAT_DRIVERS
Definition: resource.h:178
SHORT WINAPI GetKeyState(_In_ int)
BOOL UninstallApplication(BOOL bModify)
Definition: installed.cpp:139
HWND Create(HWND hwndParent, HMENU hMenu)
Definition: rosctrls.h:460
virtual VOID AppendTabOrderWindow(int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
Definition: rosui.h:500
#define IDI_CAT_OTHER
Definition: resource.h:31
BOOL SelectItem(HTREEITEM item, DWORD action=TVGN_CARET)
Definition: rosctrls.h:602
HWND Create(HWND hwndParent)
Definition: rosui.h:803
#define CS_VREDRAW
Definition: winuser.h:653
BOOL WINAPI SystemParametersInfoW(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
HMENU GetMenu() const
Definition: atlwin.h:636
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define _T(x)
Definition: vfdio.h:22
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:20
BOOL m_DynamicFirst
Definition: rosui.h:543
#define IDS_CAT_OTHER
Definition: resource.h:187
BOOL Enum(INT EnumType, AVAILENUMPROC lpEnumProc, PVOID param)
Definition: available.cpp:448
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
INT GetSystemColorDepth()
Definition: misc.cpp:489
void HandleTabOrder(int direction)
Definition: gui.cpp:828
#define WM_SIZE
Definition: winuser.h:1593
_In_ WDFCOLLECTION _In_ ULONG Index
#define TVN_SELCHANGED
Definition: commctrl.h:3731
#define WM_TIMER
Definition: winuser.h:1724
BOOL CreateLayout()
Definition: gui.cpp:187
#define MF_ENABLED
Definition: winuser.h:128
#define WM_CLOSE
Definition: winuser.h:1603
#define IDI_CAT_TOOLS
Definition: resource.h:33
GLfloat param
Definition: glext.h:5796
BOOL UpdateWindow()
Definition: atlwin.h:1277
#define IDI_CAT_EDU
Definition: resource.h:23
PCXSTR GetString() const
Definition: atlsimpstr.h:361
CUiCollection & First()
Definition: rosui.h:567
VOID ShowAboutDlg()
Definition: gui.cpp:519
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDI_CAT_INTERNET
Definition: resource.h:28
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
#define HOTKEYS
Definition: resource.h:232
#define SIZE_MINIMIZED
Definition: winuser.h:2481
BOOL m_Horizontal
Definition: rosui.h:542
INT WINAPI ImageList_AddIcon(HIMAGELIST himl, HICON hIcon)
Definition: imagelist.c:540
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
BOOL IsInstalledEnum(INT x)
Definition: defines.h:71
#define ID_CHECK_ALL
Definition: resource.h:85
#define TVE_EXPAND
Definition: commctrl.h:3419
#define TVI_ROOT
Definition: commctrl.h:3364
static const WCHAR IconIndex[]
Definition: install.c:52
VOID LayoutCleanup()
Definition: gui.cpp:220
#define IDS_CAT_LIBS
Definition: resource.h:185
int WINAPI TranslateAcceleratorW(_In_ HWND, _In_ HACCEL, _In_ LPMSG)
void AddItem(DWORD, DWORD, DWORD, DWORD, int)
Definition: toolspage.c:25
HWND hMainWnd
Definition: magnifier.c:32
LRESULT OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: winproc.cpp:304
CApplicationView * m_ApplicationView
Definition: gui.h:55
int GetSelectedCount()
Definition: available.cpp:568
VOID DestroyImageList()
Definition: gui.cpp:79
static const WCHAR L[]
Definition: oid.c:1250
~CMainWindow()
Definition: gui.cpp:101
#define IDS_CAT_THEMES
Definition: resource.h:191
#define IDI_MAIN
Definition: resource.h:4
BOOL CreateApplicationView()
Definition: gui.cpp:160
HWND Create()
Definition: gui.cpp:732
#define COLOR_BTNFACE
Definition: winuser.h:918
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
VOID UpdateStatusBarText()
Definition: gui.cpp:660
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
#define ILC_MASK
Definition: commctrl.h:347
BOOL AddSelected(CAvailableApplicationInfo *AvlbInfo)
Definition: available.cpp:546
static VOID SetImageList(HWND hwnd)
Definition: mplay32.c:238
#define IDS_CAT_SCIENCE
Definition: resource.h:188
static LRESULT CALLBACK StartWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1530
HWND m_hWnd
Definition: atlwin.h:268
#define IDS_CAT_GRAPHICS
Definition: resource.h:183
BOOL UninstallSelectedApp(BOOL bModify)
Definition: gui.cpp:299
BOOL GetItem(TV_ITEM *pitem)
Definition: rosctrls.h:543
VOID CreateSettingsDlg(HWND hwnd)
#define WM_COMMAND
Definition: winuser.h:1722
#define IDS_CAT_AUDIO
Definition: resource.h:176
static BOOL ForceUpdateAppsDB()
Definition: available.cpp:442
CUiAlignment m_VerticalAlignment
Definition: rosui.h:243
#define ID_EXIT
Definition: resource.h:10
#define IDS_CAT_EDU
Definition: resource.h:179
#define TVIF_HANDLE
Definition: commctrl.h:3266
#define IDS_CAT_ENGINEER
Definition: resource.h:180
CAvailableApps m_AvailableApps
Definition: gui.h:57
#define IDS_APPLICATIONS
Definition: resource.h:102
VOID SetText(LPCWSTR lpszText)
Definition: rosctrls.h:455
#define SEARCH_TIMER_ID
Definition: gui.cpp:32
INT m_Pos
Definition: rosui.h:541
#define TV_ITEM
Definition: commctrl.h:3296
#define IDS_APP_REG_REMOVE
Definition: resource.h:106
VOID UpdateApplicationsList(INT EnumType)
Definition: gui.cpp:671
HINSTANCE hInst
Definition: dxdiag.c:13
#define IDI_CAT_LIBS
Definition: resource.h:29
BOOL ShowWindow(int nCmdShow)
Definition: atlwin.h:1265
#define ID_INSTALL
Definition: resource.h:74
HICON hIcon
Definition: msconfig.c:44
#define RDW_ALLCHILDREN
Definition: winuser.h:1207
#define IDI_CAT_GRAPHICS
Definition: resource.h:27
#define LR_CREATEDIBSECTION
Definition: winuser.h:1088
#define IDI_CAT_THEMES
Definition: resource.h:35
#define IDI_CAT_FINANCE
Definition: resource.h:25
unsigned int UINT
Definition: ndis.h:50
#define IDS_UPDATES
Definition: resource.h:101
LRESULT OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: winproc.cpp:372
#define NULL
Definition: types.h:112
#define IDI_CAT_DRIVERS
Definition: resource.h:22
#define MB_OK
Definition: winuser.h:784
#define IDS_INFORMATION
Definition: resource.h:107
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
CUiCollection & Children()
Definition: rosui.h:359
BOOL DownloadListOfApplications(const ATL::CSimpleArray< CAvailableApplicationInfo > &AppsList, BOOL bIsModal)
Definition: loaddlg.cpp:1011
CMainWindow()
Definition: gui.cpp:95
#define IDI_CAT_AUDIO
Definition: resource.h:20
HWND WINAPI GetFocus(void)
Definition: window.c:1909
HWND Create(HWND hwndParent)
Definition: rosctrls.h:481
#define IDI_CAT_GAMES
Definition: resource.h:26
#define IDC_ARROW
Definition: winuser.h:682
#define TVSIL_NORMAL
Definition: commctrl.h:3439
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDS_CAT_TOOLS
Definition: resource.h:189
BOOL SearchTextChanged(ATL::CStringW &SearchText)
Definition: gui.cpp:812
#define WM_CREATE
Definition: winuser.h:1590
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
BOOL bSaveWndPos
Definition: settings.h:7
#define HIWORD(l)
Definition: typedefs.h:247
#define IDI_CAT_SCIENCE
Definition: resource.h:32
static ATL::CWndClassInfo & GetWndClassInfo()
Definition: gui.cpp:708
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
VOID InitCategoriesList()
Definition: gui.cpp:106
LONG bottom
Definition: windef.h:309
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5694
#define TVIF_PARAM
Definition: commctrl.h:3264
static BOOL CALLBACK s_EnumInstalledAppProc(CInstalledApplicationInfo *Info, PVOID param)
Definition: gui.cpp:641
#define MF_GRAYED
Definition: winuser.h:129
#define IDI_APPS
Definition: resource.h:11
LONG_PTR LRESULT
Definition: windef.h:209
CUiMargin m_Margin
Definition: rosui.h:240
BOOL CreateVSplitter()
Definition: gui.cpp:170
#define ID_HELP
Definition: resource.h:26
#define TREEVIEW_ICON_SIZE
Definition: gui.cpp:33
#define SW_MAXIMIZE
Definition: winuser.h:766
BOOL DownloadApplication(CAvailableApplicationInfo *pAppInfo, BOOL bIsModal)
Definition: loaddlg.cpp:1028
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define IDS_APP_AUTHORS
Definition: resource.h:122
CUiPanel * m_ClientPanel
Definition: gui.h:49
virtual DWORD_PTR CountSizableChildren()
Definition: rosui.h:407
#define IDS_CAT_GAMES
Definition: resource.h:182
LPARAM lParam
Definition: combotst.c:139
#define IDI_SELECTEDFORINST
Definition: resource.h:16
#define LOWORD(l)
Definition: pedump.c:82
BOOL RemoveSelected(CAvailableApplicationInfo *AvlbInfo)
Definition: available.cpp:551
#define ID_MODIFY
Definition: resource.h:78
PVOID GetFocusedItemData()
Definition: appview.cpp:2004
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_NOTIFY
Definition: richedit.h:61
char * Text
Definition: combotst.c:136
#define RDW_INVALIDATE
Definition: winuser.h:1200
BOOL ItemCheckStateChanged(BOOL bChecked, LPVOID CallbackParam)
Definition: gui.cpp:751
HTREEITEM GetSelection()
Definition: rosctrls.h:592
#define IDI_APPUPD
Definition: resource.h:12
int Find(const T &t) const
Definition: atlsimpcoll.h:82
CSideTreeView * m_TreeView
Definition: gui.h:52
CUiWindow< CStatusBar > * m_StatusBar
Definition: gui.h:53