ReactOS  0.4.15-dev-5452-g3c95c95
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 <ui/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 {
54  ATL::CStringW szText;
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_SEARCH:
550  break;
551 
552  case ID_INSTALL:
554  {
556 
557  // enum all selected apps
559 
560  if (AppsList.GetSize())
561  {
562  if (DownloadListOfApplications(AppsList, FALSE))
563  {
566  }
567  }
568  else
569  {
570  // use the currently focused item in application-view
572  if (FocusedApps)
573  {
574  if (DownloadApplication(FocusedApps))
575  {
577  }
578  }
579  else
580  {
581  // TODO: in this case, Install button in toolbar (and all other places) should be disabled
582  // or at least popup a messagebox telling user to select/check some app first
583  }
584  }
585  }
586  break;
587 
588  case ID_UNINSTALL:
591  break;
592 
593  case ID_MODIFY:
596  break;
597 
598  case ID_REGREMOVE:
600  break;
601 
602  case ID_REFRESH:
604  break;
605 
606  case ID_RESETDB:
609  break;
610 
611  case ID_HELP:
612  MessageBoxW(L"Help not implemented yet", NULL, MB_OK);
613  break;
614 
615  case ID_ABOUT:
616  ShowAboutDlg();
617  break;
618 
619  case ID_CHECK_ALL:
621  break;
622  }
623  }
624 }
625 
627 {
628  if (!SearchPatternMatch(Info->szDisplayName.GetString(), szSearchPattern))
629  {
630  return TRUE;
631  }
632  return m_ApplicationView->AddInstalledApplication(Info, Info); // currently, the callback param is Info itself
633 }
634 
636 {
637  if (!SearchPatternMatch(Info->m_szName.GetString(), szSearchPattern) &&
638  !SearchPatternMatch(Info->m_szDesc.GetString(), szSearchPattern))
639  {
640  return TRUE;
641  }
642  return m_ApplicationView->AddAvailableApplication(Info, bInitialCheckState, Info); // currently, the callback param is Info itself
643 }
644 
646 {
647  CMainWindow *pThis = (CMainWindow *)param;
648  return pThis->EnumInstalledAppProc(Info);
649 }
650 
652 {
653  CMainWindow *pThis = (CMainWindow *)param;
654  return pThis->EnumAvailableAppProc(Info, bInitialCheckState);
655 }
656 
658 {
660  pAppList->Add(*Info);
661  return TRUE;
662 }
663 
665 {
666  if (m_StatusBar)
667  {
668  ATL::CStringW szBuffer;
669 
671  m_StatusBar->SetText(szBuffer);
672  }
673 }
674 
676 {
677  bUpdating = TRUE;
678 
679  if (EnumType == -1)
680  {
681  // keep the old enum type
682  EnumType = SelectedEnumType;
683  }
684  else
685  {
686  SelectedEnumType = EnumType;
687  }
688 
690  if (IsInstalledEnum(EnumType))
691  {
692  // set the display type of application-view. this will remove all the item in application-view too.
694 
695  // enum installed softwares
697  }
698  else if (IsAvailableEnum(EnumType))
699  {
700  // set the display type of application-view. this will remove all the item in application-view too.
702 
703  // enum available softwares
705  }
707  m_ApplicationView->RedrawWindow(0, 0, RDW_INVALIDATE | RDW_ALLCHILDREN); // force the child window to repaint
709 
710  CStringW text;
712  {
713  text.LoadString(IDS_NO_SEARCH_RESULTS);
714  }
716 
717  bUpdating = FALSE;
718 }
719 
721 {
722  DWORD csStyle = CS_VREDRAW | CS_HREDRAW;
723  static ATL::CWndClassInfo wc =
724  {
725  {
726  sizeof(WNDCLASSEX),
727  csStyle,
729  0,
730  0,
731  NULL,
732  LoadIconW(_AtlBaseModule.GetModuleInstance(), MAKEINTRESOURCEW(IDI_MAIN)),
734  (HBRUSH)(COLOR_BTNFACE + 1),
737  NULL
738  },
739  NULL, NULL, IDC_ARROW, TRUE, 0, _T("")
740  };
741  return wc;
742 }
743 
745 {
746  ATL::CStringW szWindowName;
747  szWindowName.LoadStringW(IDS_APPTITLE);
748 
749  RECT r = {
754  };
755  r.right += r.left;
756  r.bottom += r.top;
757 
759 }
760 
761 // this function is called when a item of application-view is checked/unchecked
762 // CallbackParam is the param passed to application-view when adding the item (the one getting focus now).
764 {
765  if (!bUpdating)
766  {
767  if (bChecked)
768  {
770  {
771  return FALSE;
772  }
773  }
774  else
775  {
777  {
778  return FALSE;
779  }
780  }
781 
783  return TRUE;
784  }
785  else
786  {
787  return TRUE;
788  }
789 }
790 
791 // this function is called when one or more application(s) should be installed install
792 // if Info is not zero, this app should be installed. otherwise those checked apps should be installed
794 {
795  if (Info)
796  {
798  {
800  return TRUE;
801  }
802  }
803  else
804  {
806 
807  // enum all selected apps
809 
810  if (AppsList.GetSize())
811  {
812  if (DownloadListOfApplications(AppsList, FALSE))
813  {
816  return TRUE;
817  }
818  }
819  }
820 
821  return FALSE;
822 }
823 
825 {
826  if (szSearchPattern == SearchText)
827  {
828  return FALSE;
829  }
830 
831  szSearchPattern = SearchText;
832 
833  DWORD dwDelay;
834  SystemParametersInfoW(SPI_GETMENUSHOWDELAY, 0, &dwDelay, 0);
835  SetTimer(SEARCH_TIMER_ID, dwDelay);
836 
837  return TRUE;
838 }
839 
840 void CMainWindow::HandleTabOrder(int direction)
841 {
842  ATL::CSimpleArray<HWND> TabOrderHwndList;
843 
844  m_TreeView->AppendTabOrderWindow(direction, TabOrderHwndList);
845  m_ApplicationView->AppendTabOrderWindow(direction, TabOrderHwndList);
846 
847 
848  if (TabOrderHwndList.GetSize() == 0)
849  {
850  // in case the list is empty
851  return;
852  }
853 
854  int FocusIndex;
855 
856  if ((FocusIndex = TabOrderHwndList.Find(GetFocus())) == -1)
857  {
858  FocusIndex = 0; // focus the first window in the list
859  }
860  else
861  {
862  FocusIndex += direction;
863  FocusIndex += TabOrderHwndList.GetSize(); // FocusIndex might be negative. we don't want to mod a negative number
864  FocusIndex %= TabOrderHwndList.GetSize();
865  }
866 
867  ::SetFocus(TabOrderHwndList[FocusIndex]);
868  return;
869 }
870 // **** CMainWindow ****
871 
872 
873 
875 {
876  HACCEL KeyBrd;
877  MSG Msg;
878 
879  CMainWindow* wnd = new CMainWindow();
880  if (!wnd)
881  return;
882 
883  hMainWnd = wnd->Create();
884  if (!hMainWnd)
885  return;
886 
887  /* Maximize it if we must */
889  wnd->UpdateWindow();
890 
891  /* Load the menu hotkeys */
893 
894  /* Message Loop */
895  while (GetMessageW(&Msg, NULL, 0, 0))
896  {
897  if (!TranslateAcceleratorW(hMainWnd, KeyBrd, &Msg))
898  {
899  if (Msg.message == WM_CHAR &&
900  Msg.wParam == VK_TAB)
901  {
902  // Move backwards if shift is held down
903  int direction = (GetKeyState(VK_SHIFT) & 0x8000) ? -1 : 1;
904 
905  wnd->HandleTabOrder(direction);
906  continue;
907  }
908 
911  }
912  }
913 
914  delete wnd;
915 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
CUiSplitPanel * m_VSplitter
Definition: gui.h:50
#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:1616
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:2039
HWND SetFocus()
Definition: atlwin.h:1192
#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:2030
#define ERROR_SUCCESS
Definition: deptool.c:10
#define WM_CHAR
Definition: winuser.h:1707
#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:178
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
_In_ BOOLEAN Create
Definition: pstypes.h:527
#define IDS_APPS_COUNT
Definition: resource.h:95
const WCHAR * text
Definition: package.c:1799
BOOL bUpdating
Definition: gui.h:60
CInstalledApps m_InstalledApps
Definition: gui.h:58
VOID SetWatermark(const CStringW &Text)
Definition: appview.cpp:2048
GLuint GLuint GLsizei count
Definition: gl.h:1545
VOID RemoveAllSelected()
Definition: available.cpp:567
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:3643
~CSideTreeView()
Definition: gui.cpp:85
HTREEITEM AddCategory(HTREEITEM hRootItem, UINT TextIndex, UINT IconIndex)
Definition: gui.cpp:52
#define IDS_CAT_OFFICE
Definition: resource.h:187
#define CS_HREDRAW
Definition: winuser.h:648
static BOOL CALLBACK s_EnumSelectedAppForDownloadProc(CAvailableApplicationInfo *Info, BOOL bInitialCheckState, PVOID param)
Definition: gui.cpp:657
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:753
#define IDI_CAT_DEVEL
Definition: resource.h:21
#define IDI_CATEGORY
Definition: resource.h:13
UINT_PTR WPARAM
Definition: windef.h:207
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define VK_TAB
Definition: winuser.h:2189
#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:191
#define WS_CLIPCHILDREN
Definition: pedump.c:619
CSideTreeView()
Definition: gui.cpp:39
VOID FreeLogs()
Definition: misc.cpp:218
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:182
#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:2069
WPARAM wParam
Definition: combotst.c:138
#define IDS_AVAILABLEFORINST
Definition: resource.h:100
struct tagNMHDR * LPNMHDR
VOID FreeCachedEntries()
Definition: installed.cpp:359
BOOL CALLBACK EnumInstalledAppProc(CInstalledApplicationInfo *Info)
Definition: gui.cpp:626
BOOL SearchPatternMatch(LPCWSTR szHaystack, LPCWSTR szNeedle)
Definition: misc.cpp:404
#define IDS_INSTALLED
Definition: resource.h:99
BOOL SetDisplayAppType(APPLICATION_VIEW_TYPE AppType)
Definition: appview.cpp:1976
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:874
HWND Create(HWND hwndParent)
Definition: appview.cpp:1967
void SaveSettings(void)
Definition: settings.c:115
const TCHAR szWindowClass[]
Definition: magnifier.c:28
#define L(x)
Definition: ntvdm.h:50
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
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:1252
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:599
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:242
void SetRedraw(BOOL bRedraw)
Definition: appview.cpp:1740
#define CW_USEDEFAULT
Definition: winuser.h:225
BOOL KillTimer(UINT_PTR nIDEvent)
Definition: atlwin.h:970
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:810
VOID FreeCachedEntries()
Definition: available.cpp:341
#define VK_SHIFT
Definition: winuser.h:2192
#define WM_SIZING
Definition: winuser.h:1797
HACCEL WINAPI LoadAcceleratorsW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
static BOOL CALLBACK s_EnumAvailableAppProc(CAvailableApplicationInfo *Info, BOOL bInitialCheckState, PVOID param)
Definition: gui.cpp:651
#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:65
#define ID_ABOUT
Definition: charmap.c:17
#define IDS_CAT_INTERNET
Definition: resource.h:185
INT m_MinSecond
Definition: rosui.h:545
BOOL CALLBACK EnumAvailableAppProc(CAvailableApplicationInfo *Info, BOOL bInitialCheckState)
Definition: gui.cpp:635
HIMAGELIST SetImageList()
Definition: gui.cpp:74
#define b
Definition: ke_i.h:79
BOOL Enum(INT EnumType, APPENUMPROC lpEnumProc, PVOID param)
Definition: installed.cpp:247
BOOL InstallApplication(CAvailableApplicationInfo *Info)
Definition: gui.cpp:793
#define WM_DESTROY
Definition: winuser.h:1599
#define IDS_CAT_DRIVERS
Definition: resource.h:179
SHORT WINAPI GetKeyState(_In_ int)
BOOL UninstallApplication(BOOL bModify)
Definition: installed.cpp:209
HWND Create(HWND hwndParent, HMENU hMenu)
Definition: rosctrls.h:462
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:604
HWND Create(HWND hwndParent)
Definition: rosui.h:803
BOOL DownloadApplication(CAvailableApplicationInfo *pAppInfo)
Definition: loaddlg.cpp:1061
#define CS_VREDRAW
Definition: winuser.h:653
HMENU GetMenu() const
Definition: atlwin.h:676
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:188
BOOL Enum(INT EnumType, AVAILENUMPROC lpEnumProc, PVOID param)
Definition: available.cpp:444
INT GetSystemColorDepth()
Definition: misc.cpp:367
void HandleTabOrder(int direction)
Definition: gui.cpp:840
#define WM_SIZE
Definition: winuser.h:1601
_In_ WDFCOLLECTION _In_ ULONG Index
#define TVN_SELCHANGED
Definition: commctrl.h:3735
#define WM_TIMER
Definition: winuser.h:1732
BOOL CreateLayout()
Definition: gui.cpp:187
#define MF_ENABLED
Definition: winuser.h:128
#define WM_CLOSE
Definition: winuser.h:1611
#define IDI_CAT_TOOLS
Definition: resource.h:33
GLfloat param
Definition: glext.h:5796
BOOL UpdateWindow()
Definition: atlwin.h:1339
#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:233
#define SIZE_MINIMIZED
Definition: winuser.h:2496
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:70
#define ID_CHECK_ALL
Definition: resource.h:85
#define TVE_EXPAND
Definition: commctrl.h:3423
#define TVI_ROOT
Definition: commctrl.h:3368
void SetFocusOnSearchBar()
Definition: appview.cpp:1746
static const WCHAR IconIndex[]
Definition: install.c:52
VOID LayoutCleanup()
Definition: gui.cpp:220
#define IDS_CAT_LIBS
Definition: resource.h:186
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:362
CApplicationView * m_ApplicationView
Definition: gui.h:55
int GetSelectedCount()
Definition: available.cpp:573
VOID DestroyImageList()
Definition: gui.cpp:79
~CMainWindow()
Definition: gui.cpp:101
#define IDS_CAT_THEMES
Definition: resource.h:192
#define IDI_MAIN
Definition: resource.h:4
BOOL CreateApplicationView()
Definition: gui.cpp:160
HWND Create()
Definition: gui.cpp:744
#define COLOR_BTNFACE
Definition: winuser.h:922
VOID UpdateStatusBarText()
Definition: gui.cpp:664
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
#define ILC_MASK
Definition: commctrl.h:351
BOOL AddSelected(CAvailableApplicationInfo *AvlbInfo)
Definition: available.cpp:551
static VOID SetImageList(HWND hwnd)
Definition: mplay32.c:238
#define IDS_CAT_SCIENCE
Definition: resource.h:189
static LRESULT CALLBACK StartWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1613
HWND m_hWnd
Definition: atlwin.h:267
#define IDS_CAT_GRAPHICS
Definition: resource.h:184
BOOL UninstallSelectedApp(BOOL bModify)
Definition: gui.cpp:299
BOOL GetItem(TV_ITEM *pitem)
Definition: rosctrls.h:545
VOID CreateSettingsDlg(HWND hwnd)
#define WM_COMMAND
Definition: winuser.h:1730
#define IDS_CAT_AUDIO
Definition: resource.h:177
static BOOL ForceUpdateAppsDB()
Definition: available.cpp:438
CUiAlignment m_VerticalAlignment
Definition: rosui.h:243
#define ID_EXIT
Definition: resource.h:10
#define IDS_CAT_EDU
Definition: resource.h:180
#define TVIF_HANDLE
Definition: commctrl.h:3270
#define IDS_CAT_ENGINEER
Definition: resource.h:181
CAvailableApps m_AvailableApps
Definition: gui.h:57
#define IDS_APPLICATIONS
Definition: resource.h:102
bool IsEmpty() const
Definition: atlsimpstr.h:379
VOID SetText(LPCWSTR lpszText)
Definition: rosctrls.h:457
#define SEARCH_TIMER_ID
Definition: gui.cpp:32
INT m_Pos
Definition: rosui.h:541
#define TV_ITEM
Definition: commctrl.h:3300
#define IDS_APP_REG_REMOVE
Definition: resource.h:106
#define ID_SEARCH
Definition: resource.h:86
VOID UpdateApplicationsList(INT EnumType)
Definition: gui.cpp:675
HINSTANCE hInst
Definition: dxdiag.c:13
#define IDI_CAT_LIBS
Definition: resource.h:29
BOOL ShowWindow(int nCmdShow)
Definition: atlwin.h:1327
#define ID_INSTALL
Definition: resource.h:74
HICON hIcon
Definition: msconfig.c:44
#define RDW_ALLCHILDREN
Definition: winuser.h:1211
#define IDI_CAT_GRAPHICS
Definition: resource.h:27
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define LR_CREATEDIBSECTION
Definition: winuser.h:1092
#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:428
#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:1044
CMainWindow()
Definition: gui.cpp:95
#define IDI_CAT_AUDIO
Definition: resource.h:20
HWND WINAPI GetFocus(void)
Definition: window.c:1894
HWND Create(HWND hwndParent)
Definition: rosctrls.h:483
#define IDI_CAT_GAMES
Definition: resource.h:26
#define IDC_ARROW
Definition: winuser.h:682
#define TVSIL_NORMAL
Definition: commctrl.h:3443
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDS_CAT_TOOLS
Definition: resource.h:190
BOOL SearchTextChanged(ATL::CStringW &SearchText)
Definition: gui.cpp:824
#define WM_CREATE
Definition: winuser.h:1598
#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:720
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:5709
#define TVIF_PARAM
Definition: commctrl.h:3268
static BOOL CALLBACK s_EnumInstalledAppProc(CInstalledApplicationInfo *Info, PVOID param)
Definition: gui.cpp:645
#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
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
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
#define IDS_NO_SEARCH_RESULTS
Definition: resource.h:126
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
struct @1595 Msg[]
#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:183
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:556
#define ID_MODIFY
Definition: resource.h:78
PVOID GetFocusedItemData()
Definition: appview.cpp:2059
__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:1204
BOOL ItemCheckStateChanged(BOOL bChecked, LPVOID CallbackParam)
Definition: gui.cpp:763
HTREEITEM GetSelection()
Definition: rosctrls.h:594
#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