ReactOS 0.4.16-dev-295-g4aee028
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 "asyncinet.h"
14#include "gui.h"
15#include <shlobj_undoc.h>
16#include <shlguid_undoc.h>
17
18#include <atlbase.h>
19#include <atlcom.h>
20#include <atltypes.h>
21#include <atlwin.h>
22#include <wininet.h>
23#include <shellutils.h>
24#include <ui/rosctrls.h>
25#include <gdiplus.h>
26#include <math.h>
27
28#define SEARCH_TIMER_ID 'SR'
29#define TREEVIEW_ICON_SIZE 24
30
31// **** CSideTreeView ****
32
34 : CUiWindow(),
36{
37}
38
41{
42 return CUiWindow<CTreeView>::AddItem(hParent, const_cast<LPWSTR>(Text.GetString()), Image, SelectedImage, lParam);
43}
44
47{
48 CStringW szText;
49 INT Index = 0;
51
54 if (hIcon)
55 {
58 }
59
60 szText.LoadStringW(TextIndex);
61 return AddItem(hRootItem, szText, Index, Index, TextIndex);
62}
63
66{
68}
69
70VOID
72{
75}
76
78{
80}
81// **** CSideTreeView ****
82
83// **** CMainWindow ****
84
85CMainWindow::CMainWindow(CAppDB *db, BOOL bAppwiz) : m_ClientPanel(NULL), m_Db(db), m_bAppwizMode(bAppwiz), SelectedEnumType(ENUM_ALL_INSTALLED)
86{
87}
88
90{
92}
93
94VOID
96{
97 HTREEITEM hRootItemAvailable;
98
102
103 // Do not show any other categories in APPWIZ-mode.
104 if (m_bAppwizMode)
105 goto Finish;
106
108
110 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_AUDIO, IDI_CAT_AUDIO);
111 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_VIDEO, IDI_CAT_VIDEO);
113 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_GAMES, IDI_CAT_GAMES);
116 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_DEVEL, IDI_CAT_DEVEL);
117 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_EDU, IDI_CAT_EDU);
121 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_TOOLS, IDI_CAT_TOOLS);
123 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_LIBS, IDI_CAT_LIBS);
125 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_OTHER, IDI_CAT_OTHER);
126
127Finish:
130 if (!m_bAppwizMode)
131 m_TreeView->Expand(hRootItemAvailable, TVE_EXPAND);
132 m_TreeView->SelectItem(m_bAppwizMode ? hRootItemInstalled : hRootItemAvailable);
133}
134
135BOOL
137{
142
144}
145
146BOOL
148{
153
154 return m_TreeView->Create(m_hWnd) != NULL;
155}
156
157BOOL
159{
160 m_ApplicationView = new CApplicationView(this); // pass this to ApplicationView for callback purpose
164
166}
167
168BOOL
170{
177
178 // TODO: m_MinSecond should be calculate dynamically instead of hard-coded
180 m_VSplitter->m_Pos = 240;
182
183 return m_VSplitter->Create(m_hWnd) != NULL;
184}
185
186BOOL
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();
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
217 return b;
218}
219
220VOID
222{
223 delete m_TreeView;
224 delete m_ApplicationView;
225 delete m_VSplitter;
226 delete m_StatusBar;
227 return;
228}
229
230BOOL
232{
233 if (CreateLayout())
234 {
237
238 return TRUE;
239 }
240
241 return FALSE;
242}
243
244VOID
246{
247 if (wParam == SIZE_MINIMIZED)
248 return;
249
250 /* Size status bar */
251 m_StatusBar->SendMessage(WM_SIZE, 0, 0);
252
253 RECT r = {0, 0, LOWORD(lParam), HIWORD(lParam)};
254 HDWP hdwp = NULL;
256
258 if (hdwp)
259 {
260 hdwp = m_ClientPanel->OnParentSize(r, hdwp);
261 if (hdwp)
262 {
263 EndDeferWindowPos(hdwp);
264 }
265 }
266}
267
268BOOL
270{
272 return FALSE;
273
274 CStringW szMsgText, szMsgTitle;
275
276 if (!szMsgText.LoadStringW(IDS_APP_REG_REMOVE) || !szMsgTitle.LoadStringW(IDS_INFORMATION))
277 return FALSE;
278
280 if (!InstalledApp)
281 return FALSE;
282
283 if (MessageBoxW(szMsgText, szMsgTitle, MB_YESNO | MB_ICONQUESTION) == IDYES)
284 return m_Db->RemoveInstalledAppFromRegistry(InstalledApp) == ERROR_SUCCESS;
285
286 return FALSE;
287}
288
289BOOL
291{
293 return FALSE;
294
296 if (!InstalledApp)
297 return FALSE;
298
299 return InstalledApp->UninstallApplication(bModify ? UCF_MODIFY : UCF_NONE);
300}
301
302VOID
304{
305 if (m_Db->GetAvailableCount() == 0)
306 {
309 }
310}
311
312BOOL
314{
315 theResult = 0;
316 switch (Msg)
317 {
318 case WM_CREATE:
319 if (!InitControls())
322 break;
323
324 case WM_DESTROY:
325 {
326 hMainWnd = NULL;
328 FreeLogs();
329
330 delete m_ClientPanel;
331
333 return 0;
334 }
335
336 case WM_CLOSE:
338 return g_Busy;
339
341 if (!g_Busy && !IsWindowVisible())
342 SendMessage(WM_CLOSE, 0, 0);
343 break;
344
345 case DM_REPOSITION:
346 EmulateDialogReposition(hwnd); // We are not a real dialog, we need help from a real one
347 break;
348
349 case WM_COMMAND:
351 break;
352
353 case WM_NOTIFY:
354 {
356
357 switch (data->code)
358 {
360 {
361 if (data->hwndFrom == m_TreeView->m_hWnd)
362 {
363 // APPWIZ-mode: forbid item collapse.
364 // FIXME: Prevent collapse (COMCTL32 is buggy)
365 // https://bugs.winehq.org/show_bug.cgi?id=53727
367 {
368 theResult = TRUE;
369 return TRUE; // Handled
370 }
371 }
372 break;
373 }
374
375 case TVN_SELCHANGED:
376 {
377 if (data->hwndFrom == m_TreeView->m_hWnd)
378 {
379 switch (((LPNMTREEVIEW)lParam)->itemNew.lParam)
380 {
381 case IDS_INSTALLED:
383 break;
384
385 case IDS_APPLICATIONS:
387 break;
388
389 case IDS_UPDATES:
391 break;
392
395 break;
396
397 case IDS_CAT_AUDIO:
399 break;
400
401 case IDS_CAT_DEVEL:
403 break;
404
405 case IDS_CAT_DRIVERS:
407 break;
408
409 case IDS_CAT_EDU:
411 break;
412
413 case IDS_CAT_ENGINEER:
415 break;
416
417 case IDS_CAT_FINANCE:
419 break;
420
421 case IDS_CAT_GAMES:
423 break;
424
425 case IDS_CAT_GRAPHICS:
427 break;
428
429 case IDS_CAT_INTERNET:
431 break;
432
433 case IDS_CAT_LIBS:
435 break;
436
437 case IDS_CAT_OFFICE:
439 break;
440
441 case IDS_CAT_OTHER:
443 break;
444
445 case IDS_CAT_SCIENCE:
447 break;
448
449 case IDS_CAT_TOOLS:
451 break;
452
453 case IDS_CAT_VIDEO:
455 break;
456
457 case IDS_CAT_THEMES:
459 break;
460
463 break;
464 }
465 }
466 }
467 break;
468 }
469 }
470 break;
471
472 case WM_SIZE:
474 break;
475
476 case WM_SIZING:
477 {
478 LPRECT pRect = (LPRECT)lParam;
479
480 if (pRect->right - pRect->left < 565)
481 pRect->right = pRect->left + 565;
482
483 if (pRect->bottom - pRect->top < 300)
484 pRect->bottom = pRect->top + 300;
485
486 return TRUE;
487 }
488
490 {
491 /* Forward WM_SYSCOLORCHANGE to common controls */
493 m_TreeView->SendMessageW(WM_SYSCOLORCHANGE, wParam, lParam);
494 }
495 break;
496
497 case WM_SETTINGCHANGE:
498 if (wParam == SPI_SETNONCLIENTMETRICS || wParam == SPI_SETICONMETRICS)
499 {
501 g_hDefaultPackageIcon = NULL; // Trigger imagelist recreation on next load
502 }
503 break;
504
505 case WM_TIMER:
506 if (wParam == SEARCH_TIMER_ID)
507 {
509
511 }
512 break;
513 }
514
515 return FALSE;
516}
517
518VOID
520{
521 CStringW szApp;
522 CStringW szAuthors;
523
524 szApp.LoadStringW(IDS_APPTITLE);
525 szAuthors.LoadStringW(IDS_APP_AUTHORS);
526 ShellAboutW(m_hWnd, szApp, szAuthors,
528}
529
530VOID
532{
533 const BOOL bReload = TRUE;
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 {
555 if (!m_Selected.IsEmpty())
556 {
558 {
561 }
562 }
563 else
564 {
566 if (App)
567 {
569 }
570 }
571 }
572 break;
573
574 case ID_UNINSTALL:
577 break;
578
579 case ID_MODIFY:
582 break;
583
584 case ID_REGREMOVE:
587 break;
588
589 case ID_REFRESH:
591 break;
592
593 case ID_RESETDB:
596 break;
597
598 case ID_HELP:
599 MessageBoxW(L"Help not implemented yet", NULL, MB_OK);
600 break;
601
602 case ID_ABOUT:
603 ShowAboutDlg();
604 break;
605
606 case ID_CHECK_ALL:
608 break;
609
613 break;
614 }
615 }
616}
617
618VOID
620{
621 if (m_StatusBar)
622 {
623 CStringW szBuffer;
625
626 // Append the number of selected apps if not in APPWIZ-mode.
627 if (!m_bAppwizMode)
628 {
629 CStringW szBuffer2;
631 szBuffer += szBuffer2;
632 }
633
634 m_StatusBar->SetText(szBuffer);
635 }
636}
637
638VOID
640{
641 POSITION CurrentListPosition = List.GetHeadPosition();
642 while (CurrentListPosition)
643 {
644 CAppInfo *Info = List.GetNext(CurrentListPosition);
647 {
648 BOOL bSelected = m_Selected.Find(Info) != NULL;
650 }
651 }
652 m_ApplicationView->AddApplication(NULL, FALSE); // Tell the list we are done
653}
654
655VOID
657{
658 // Only installed applications should be enumerated in APPWIZ-mode.
659 if (m_bAppwizMode && !IsInstalledEnum(EnumType))
660 {
661 ATLASSERT(FALSE && "Should not be called in APPWIZ-mode");
662 return;
663 }
664
665 bUpdating = TRUE;
666
667 if (HCURSOR hCursor = LoadCursor(NULL, IDC_APPSTARTING))
668 {
669 // The database (.ini files) is parsed on the UI thread, let the user know we are busy
670 SetCursor(hCursor);
672 }
673
674 if (bCheckAvailable)
676
677 BOOL TryRestoreSelection = SelectedEnumType == EnumType;
678 if (SelectedEnumType != EnumType)
679 SelectedEnumType = EnumType;
680
682 if (TryRestoreSelection)
684
685 if (bReload)
687
689 if (IsInstalledEnum(EnumType))
690 {
691 if (bReload)
693
694 // set the display type of application-view. this will remove all the item in application-view too.
696
698 m_Db->GetApps(List, EnumType);
700 }
701 else if (IsAvailableEnum(EnumType))
702 {
703 // We shouldn't get there in APPWIZ-mode.
705
706 if (bReload)
708
709 // set the display type of application-view. this will remove all the item in application-view too.
711
712 // enum available softwares
713 if (EnumType == ENUM_CAT_SELECTED)
714 {
716 }
717 else
718 {
720 m_Db->GetApps(List, EnumType);
722 }
723 }
724 else
725 {
726 ATLASSERT(0 && "This should be unreachable!");
727 }
728
729 if (TryRestoreSelection)
730 m_ApplicationView->RestoreListSelection(RestoreSelection);
732 m_ApplicationView->RedrawWindow(0, 0, RDW_INVALIDATE | RDW_ALLCHILDREN); // force the child window to repaint
734
737 {
738 text.LoadString(IDS_NO_SEARCH_RESULTS);
739 }
741
743}
744
747{
748 DWORD csStyle = CS_VREDRAW | CS_HREDRAW;
749 static ATL::CWndClassInfo wc = {
750 {sizeof(WNDCLASSEX), csStyle, StartWindowProc, 0, 0, NULL,
751 LoadIconW(_AtlBaseModule.GetModuleInstance(), MAKEINTRESOURCEW(IDI_MAIN)), LoadCursorW(NULL, IDC_ARROW),
753 NULL,
754 NULL,
755 IDC_ARROW,
756 TRUE,
757 0,
758 _T("")};
759 return wc;
760}
761
762HWND
764{
766
767 RECT r = {
771 r.right += r.left;
772 r.bottom += r.top;
773
774 return CWindowImpl::Create(
776}
777
778// this function is called when a item of application-view is checked/unchecked
779// CallbackParam is the param passed to application-view when adding the item (the one getting focus now).
780VOID
782{
783 if (bUpdating)
784 return;
785
786 CAppInfo *Info = (CAppInfo *)CallbackParam;
787
788 if (bChecked)
789 {
791 }
792 else
793 {
795 ATLASSERT(Pos != NULL);
796
797 if (Pos != NULL)
798 {
800 }
801 }
802
804}
805
806// this function is called when one or more application(s) should be installed
807// if Info is not zero, this app should be installed. otherwise those checked apps should be installed
808BOOL
810{
811 if (Info)
812 {
814 {
816 return TRUE;
817 }
818 }
819
820 return FALSE;
821}
822
823BOOL
825{
826 if (szSearchPattern == SearchText)
827 {
828 return FALSE;
829 }
830
831 szSearchPattern = SearchText;
832
833 DWORD dwDelay = 0;
834 SystemParametersInfoW(SPI_GETMENUSHOWDELAY, 0, &dwDelay, 0);
835 SetTimer(SEARCH_TIMER_ID, dwDelay);
836
837 return TRUE;
838}
839
840void
842{
843 ATL::CSimpleArray<HWND> TabOrderHwndList;
844
845 m_TreeView->AppendTabOrderWindow(direction, TabOrderHwndList);
846 m_ApplicationView->AppendTabOrderWindow(direction, TabOrderHwndList);
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 +=
864 TabOrderHwndList.GetSize(); // FocusIndex might be negative. we don't want to mod a negative number
865 FocusIndex %= TabOrderHwndList.GetSize();
866 }
867
868 ::SetFocus(TabOrderHwndList[FocusIndex]);
869 return;
870}
871// **** CMainWindow ****
872
873VOID
875{
876 HACCEL KeyBrd;
877 MSG Msg;
878
879 hMainWnd = wnd->Create();
880 if (!hMainWnd)
881 return;
882
883 /* Maximize it if we must */
885 wnd->UpdateWindow();
886
887 /* Load the menu hotkeys */
889
890 /* Message Loop */
891 while (GetMessageW(&Msg, NULL, 0, 0))
892 {
893 if (!TranslateAcceleratorW(hMainWnd, KeyBrd, &Msg))
894 {
895 if (Msg.message == WM_CHAR && Msg.wParam == VK_TAB)
896 {
897 // Move backwards if shift is held down
898 int direction = (GetKeyState(VK_SHIFT) & 0x8000) ? -1 : 1;
899
900 wnd->HandleTabOrder(direction);
901 continue;
902 }
903
906 }
907 }
908}
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
BOOL IsAvailableEnum(INT x)
Definition: appinfo.h:55
BOOL IsInstalledEnum(INT x)
Definition: appinfo.h:61
@ UCF_NONE
Definition: appinfo.h:68
@ UCF_MODIFY
Definition: appinfo.h:69
AppsCategories
Definition: appinfo.h:25
@ ENUM_CAT_LIBS
Definition: appinfo.h:40
@ ENUM_CAT_ENGINEER
Definition: appinfo.h:35
@ ENUM_CAT_VIDEO
Definition: appinfo.h:28
@ ENUM_CAT_FINANCE
Definition: appinfo.h:36
@ ENUM_CAT_OFFICE
Definition: appinfo.h:32
@ ENUM_CAT_EDU
Definition: appinfo.h:34
@ ENUM_CAT_AUDIO
Definition: appinfo.h:27
@ ENUM_CAT_TOOLS
Definition: appinfo.h:38
@ ENUM_UPDATES
Definition: appinfo.h:46
@ ENUM_CAT_SELECTED
Definition: appinfo.h:43
@ ENUM_ALL_AVAILABLE
Definition: appinfo.h:26
@ ENUM_CAT_INTERNET
Definition: appinfo.h:31
@ ENUM_CAT_GAMES
Definition: appinfo.h:30
@ ENUM_CAT_THEMES
Definition: appinfo.h:41
@ ENUM_INSTALLED_APPLICATIONS
Definition: appinfo.h:45
@ ENUM_CAT_GRAPHICS
Definition: appinfo.h:29
@ ENUM_CAT_DEVEL
Definition: appinfo.h:33
@ ENUM_CAT_DRIVERS
Definition: appinfo.h:39
@ ENUM_ALL_INSTALLED
Definition: appinfo.h:44
@ ENUM_CAT_SCIENCE
Definition: appinfo.h:37
@ ENUM_CAT_OTHER
Definition: appinfo.h:42
HICON g_hDefaultPackageIcon
Definition: appview.cpp:16
@ AppViewTypeInstalledApps
Definition: appview.h:72
@ AppViewTypeAvailableApps
Definition: appview.h:71
void SaveSettings(void)
Definition: settings.c:115
#define IDI_MAIN
Definition: resource.h:4
#define ID_EXIT
Definition: resource.h:10
#define IDS_APPTITLE
Definition: resource.h:3
#define IDR_MAINMENU
Definition: resource.h:40
#define ID_HELP
Definition: resource.h:26
#define IDC_STATUSBAR
Definition: resource.h:12
#define ID_REFRESH
Definition: resource.h:16
#define SEARCH_TIMER_ID
Definition: gui.h:21
#define TREEVIEW_ICON_SIZE
Definition: gui.h:22
VOID EmulateDialogReposition(HWND hwnd)
Definition: misc.cpp:49
VOID FreeLogs()
Definition: misc.cpp:243
INT GetSystemColorDepth()
Definition: misc.cpp:328
BOOL SearchPatternMatch(LPCWSTR szHaystack, LPCWSTR szNeedle)
Definition: misc.cpp:437
#define IDS_UPDATES
Definition: resource.h:106
#define IDS_CAT_TOOLS
Definition: resource.h:194
#define ID_REGREMOVE
Definition: resource.h:82
#define IDI_CAT_FINANCE
Definition: resource.h:25
#define IDS_CAT_VIDEO
Definition: resource.h:195
#define IDS_SELECTEDFORINST
Definition: resource.h:123
#define ID_UNINSTALL
Definition: resource.h:74
#define ID_SEARCH
Definition: resource.h:85
#define IDS_CAT_GRAPHICS
Definition: resource.h:188
#define IDI_SELECTEDFORINST
Definition: resource.h:16
#define IDI_CAT_EDU
Definition: resource.h:23
#define IDS_AVAILABLEFORINST
Definition: resource.h:105
#define IDI_CAT_INTERNET
Definition: resource.h:28
#define IDI_CAT_LIBS
Definition: resource.h:29
#define IDS_CAT_AUDIO
Definition: resource.h:181
#define IDS_INFORMATION
Definition: resource.h:112
#define IDS_APPS_COUNT
Definition: resource.h:102
#define IDS_CAT_SCIENCE
Definition: resource.h:193
#define IDS_CAT_ENGINEER
Definition: resource.h:185
#define IDI_CATEGORY
Definition: resource.h:13
#define IDI_CAT_OFFICE
Definition: resource.h:30
#define IDS_CAT_LIBS
Definition: resource.h:190
#define IDS_CAT_OTHER
Definition: resource.h:192
#define IDI_CAT_GRAPHICS
Definition: resource.h:27
#define ID_CHECK_ALL
Definition: resource.h:84
#define IDS_APPS_SELECT_COUNT
Definition: resource.h:103
#define IDS_CAT_DEVEL
Definition: resource.h:182
#define IDI_APPS
Definition: resource.h:11
#define IDS_CAT_THEMES
Definition: resource.h:196
#define IDS_APP_AUTHORS
Definition: resource.h:92
#define IDI_CAT_SCIENCE
Definition: resource.h:32
#define IDI_CAT_OTHER
Definition: resource.h:31
#define IDS_CAT_GAMES
Definition: resource.h:187
#define ID_ACTIVATE_APPWIZ
Definition: resource.h:88
#define IDS_CAT_EDU
Definition: resource.h:184
#define ID_MODIFY
Definition: resource.h:77
#define IDS_CAT_INTERNET
Definition: resource.h:189
#define IDS_NO_SEARCH_RESULTS
Definition: resource.h:129
#define IDI_APPUPD
Definition: resource.h:12
#define IDI_CAT_VIDEO
Definition: resource.h:34
#define ID_RESETDB
Definition: resource.h:83
#define IDS_CAT_DRIVERS
Definition: resource.h:183
#define IDI_CAT_DRIVERS
Definition: resource.h:22
#define HOTKEYS
Definition: resource.h:240
#define IDI_CAT_DEVEL
Definition: resource.h:21
#define IDS_CAT_OFFICE
Definition: resource.h:191
#define IDS_CAT_FINANCE
Definition: resource.h:186
#define IDI_CAT_THEMES
Definition: resource.h:35
#define IDS_APP_REG_REMOVE
Definition: resource.h:111
#define IDI_CAT_GAMES
Definition: resource.h:26
#define IDS_APPLICATIONS
Definition: resource.h:107
#define IDI_CAT_ENGINEER
Definition: resource.h:24
#define IDS_INSTALLED
Definition: resource.h:104
#define IDI_CAT_TOOLS
Definition: resource.h:33
#define IDI_CAT_AUDIO
Definition: resource.h:20
#define IDS_APPWIZ_TITLE
Definition: resource.h:96
#define ID_INSTALL
Definition: resource.h:73
#define ID_SETTINGS
Definition: resource.h:80
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:21
#define ID_ABOUT
Definition: charmap.c:17
bool IsEmpty() const
Definition: atlcoll.h:548
POSITION AddTail(INARGTYPE element)
Definition: atlcoll.h:629
void RemoveAll()
Definition: atlcoll.h:748
POSITION Find(INARGTYPE element, _In_opt_ POSITION posStartAfter=NULL) const
Definition: atlcoll.h:794
size_t GetCount() const
Definition: atlcoll.h:542
void RemoveAt(_In_ POSITION pos)
Definition: atlcoll.h:769
int GetSize() const
Definition: atlsimpcoll.h:104
int Find(const T &t) const
Definition: atlsimpcoll.h:82
bool IsEmpty() const noexcept
Definition: atlsimpstr.h:394
PXSTR GetString() noexcept
Definition: atlsimpstr.h:367
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:818
static LRESULT CALLBACK StartWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1619
HWND Create(HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
Definition: atlwin.h:1734
HWND SetFocus()
Definition: atlwin.h:1198
BOOL IsWindowVisible() const
Definition: atlwin.h:958
BOOL UpdateWindow()
Definition: atlwin.h:1345
HWND m_hWnd
Definition: atlwin.h:273
BOOL ShowWindow(int nCmdShow)
Definition: atlwin.h:1333
Definition: appdb.h:9
static DWORD RemoveInstalledAppFromRegistry(const CAppInfo *Info)
Definition: appdb.cpp:315
VOID UpdateAvailable()
Definition: appdb.cpp:121
size_t GetAvailableCount() const
Definition: appdb.h:50
VOID UpdateInstalled()
Definition: appdb.cpp:236
VOID GetApps(CAtlList< CAppInfo * > &List, AppsCategories Type) const
Definition: appdb.cpp:53
VOID RemoveCached()
Definition: appdb.cpp:291
virtual BOOL UninstallApplication(UninstallCommandFlags Flags)=0
PVOID GetFocusedItemData()
Definition: appview.cpp:2081
HWND Create(HWND hwndParent)
Definition: appview.cpp:2005
VOID GetRestoreListSelectionData(RESTORELISTSELECTION &Restore)
Definition: appview.cpp:2103
VOID RestoreListSelection(const RESTORELISTSELECTION &Restore)
Definition: appview.cpp:2120
BOOL AddApplication(CAppInfo *InstAppInfo, BOOL InitialCheckState)
Definition: appview.cpp:2063
BOOL SetDisplayAppType(APPLICATION_VIEW_TYPE AppType)
Definition: appview.cpp:2016
void SetFocusOnSearchBar()
Definition: appview.cpp:1809
void SetRedraw(BOOL bRedraw)
Definition: appview.cpp:1802
VOID AppendTabOrderWindow(int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
Definition: appview.cpp:2093
VOID SetWatermark(const CStringW &Text)
Definition: appview.cpp:2069
BOOL RemoveSelectedAppFromRegistry()
Definition: gui.cpp:269
AppsCategories SelectedEnumType
Definition: gui.h:65
BOOL m_bAppwizMode
Definition: gui.h:61
HTREEITEM hRootItemInstalled
Definition: gui.h:62
VOID UpdateStatusBarText()
Definition: gui.cpp:619
BOOL CreateLayout()
Definition: gui.cpp:187
BOOL CreateTreeView()
Definition: gui.cpp:147
CSideTreeView * m_TreeView
Definition: gui.h:51
CStringW szSearchPattern
Definition: gui.h:64
CUiSplitPanel * m_VSplitter
Definition: gui.h:49
VOID AddApplicationsToView(CAtlList< CAppInfo * > &List)
Definition: gui.cpp:639
BOOL CreateVSplitter()
Definition: gui.cpp:169
BOOL SearchTextChanged(CStringW &SearchText)
Definition: gui.cpp:824
VOID CheckAvailable()
Definition: gui.cpp:303
LRESULT OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: main.cpp:767
VOID UpdateApplicationsList(AppsCategories EnumType, BOOL bReload=FALSE, BOOL bCheckAvailable=FALSE)
Definition: gui.cpp:656
static ATL::CWndClassInfo & GetWndClassInfo()
Definition: gui.cpp:746
BOOL bUpdating
Definition: gui.h:60
~CMainWindow()
Definition: gui.cpp:89
CMainWindow()
Definition: main.h:30
void HandleTabOrder(int direction)
Definition: gui.cpp:841
BOOL InstallApplication(CAppInfo *Info)
Definition: gui.cpp:809
LRESULT OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: main.cpp:819
CAtlList< CAppInfo * > m_Selected
Definition: gui.h:58
VOID ShowAboutDlg()
Definition: gui.cpp:519
BOOL InitControls()
Definition: gui.cpp:231
friend class CApplicationView
Definition: gui.h:55
VOID InitCategoriesList()
Definition: gui.cpp:95
VOID ItemCheckStateChanged(BOOL bChecked, LPVOID CallbackParam)
Definition: gui.cpp:781
CAppDB * m_Db
Definition: gui.h:57
CUiWindow< CStatusBar > * m_StatusBar
Definition: gui.h:52
HWND Create()
Definition: gui.cpp:763
BOOL ProcessWindowMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId)
Definition: gui.cpp:313
CUiPanel * m_ClientPanel
Definition: gui.h:48
VOID LayoutCleanup()
Definition: gui.cpp:221
BOOL CreateStatusBar()
Definition: gui.cpp:136
BOOL UninstallSelectedApp(BOOL bModify)
Definition: gui.cpp:290
BOOL CreateApplicationView()
Definition: gui.cpp:158
CApplicationView * m_ApplicationView
Definition: gui.h:54
INT Append(T *ptr)
Definition: rosui.h:87
HIMAGELIST hImageTreeView
Definition: gui.h:26
CSideTreeView()
Definition: gui.cpp:33
HTREEITEM AddCategory(HTREEITEM hRootItem, UINT TextIndex, UINT IconIndex)
Definition: gui.cpp:46
HTREEITEM AddItem(HTREEITEM hParent, CStringW &Text, INT Image, INT SelectedImage, LPARAM lParam)
Definition: gui.cpp:40
~CSideTreeView()
Definition: gui.cpp:77
VOID DestroyImageList()
Definition: gui.cpp:71
HIMAGELIST SetImageList()
Definition: gui.cpp:65
VOID SetText(LPCWSTR lpszText)
Definition: rosctrls.h:457
HWND Create(HWND hwndParent, HMENU hMenu)
Definition: rosctrls.h:462
BOOL Expand(HTREEITEM item, DWORD action)
Definition: rosctrls.h:599
HWND Create(HWND hwndParent)
Definition: rosctrls.h:483
BOOL SelectItem(HTREEITEM item, DWORD action=TVGN_CARET)
Definition: rosctrls.h:604
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:257
CUiAlignment m_VerticalAlignment
Definition: rosui.h:258
CUiMargin m_Margin
Definition: rosui.h:255
CUiCollection & Children()
Definition: rosui.h:384
virtual DWORD_PTR CountSizableChildren()
Definition: rosui.h:439
virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
Definition: rosui.h:454
INT m_Pos
Definition: rosui.h:584
BOOL m_Horizontal
Definition: rosui.h:585
CUiCollection & First()
Definition: rosui.h:618
BOOL m_DynamicFirst
Definition: rosui.h:586
CUiCollection & Second()
Definition: rosui.h:623
INT m_MinSecond
Definition: rosui.h:588
HWND Create(HWND hwndParent)
Definition: rosui.h:867
INT m_MinFirst
Definition: rosui.h:587
virtual VOID AppendTabOrderWindow(int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
Definition: rosui.h:546
WPARAM wParam
Definition: combotst.c:138
char * Text
Definition: combotst.c:136
struct @1640 Msg[]
LPARAM lParam
Definition: combotst.c:139
ush Pos
Definition: deflate.h:92
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
const WCHAR * action
Definition: action.c:7509
const WCHAR * text
Definition: package.c:1794
static const WCHAR IconIndex[]
Definition: install.c:52
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
VOID MainWindowLoop(CMainWindow *wnd, INT nShowCmd)
Definition: gui.cpp:874
#define TREEVIEW_ICON_SIZE
Definition: gui.cpp:29
#define b
Definition: ke_i.h:79
HWND hMainWnd
Definition: magnifier.c:32
const TCHAR szWindowClass[]
Definition: magnifier.c:28
static HICON
Definition: imagelist.c:80
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
HICON hIcon
Definition: msconfig.c:44
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define TVN_SELCHANGED
Definition: commctrl.h:3740
#define TVSIL_NORMAL
Definition: commctrl.h:3448
#define LPNMTREEVIEW
Definition: commctrl.h:3648
#define TVE_EXPAND
Definition: commctrl.h:3428
#define TVI_ROOT
Definition: commctrl.h:3373
#define TVE_TOGGLE
Definition: commctrl.h:3429
#define TVE_COLLAPSE
Definition: commctrl.h:3427
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define TVN_ITEMEXPANDING
Definition: commctrl.h:3743
#define ILC_MASK
Definition: commctrl.h:351
BOOL DownloadApplication(CAppInfo *pAppInfo)
Definition: loaddlg.cpp:1135
VOID CreateSettingsDlg(HWND hwnd)
BOOL DownloadListOfApplications(const CAtlList< CAppInfo * > &AppsList, BOOL bIsModal)
Definition: loaddlg.cpp:1116
#define WM_NOTIFY_OPERATIONCOMPLETED
Definition: rapps.h:18
LONG g_Busy
Definition: winmain.cpp:17
#define WM_NOTIFY
Definition: richedit.h:61
@ UiAlign_Stretch
Definition: rosui.h:249
@ UiAlign_RightBtm
Definition: rosui.h:248
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
BOOL Maximized
Definition: settings.h:13
BOOL bSaveWndPos
Definition: settings.h:7
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
int32_t INT
Definition: typedefs.h:58
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define HIWORD(l)
Definition: typedefs.h:247
#define AddItem
Definition: userenv.h:209
#define _T(x)
Definition: vfdio.h:22
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
#define LPRECT
Definition: precomp.h:28
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
HICON HCURSOR
Definition: windef.h:299
HWND WINAPI GetFocus(void)
Definition: window.c:1865
#define CS_VREDRAW
Definition: winuser.h:658
#define SW_HIDE
Definition: winuser.h:771
#define WM_CLOSE
Definition: winuser.h:1624
#define VK_TAB
Definition: winuser.h:2202
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IMAGE_ICON
Definition: winuser.h:212
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1611
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SIZE
Definition: winuser.h:1614
#define LR_CREATEDIBSECTION
Definition: winuser.h:1101
#define WM_COMMAND
Definition: winuser.h:1743
#define CS_HREDRAW
Definition: winuser.h:653
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2255
#define IDC_ARROW
Definition: winuser.h:687
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define WM_MOUSEMOVE
Definition: winuser.h:1778
#define SIZE_MINIMIZED
Definition: winuser.h:2509
#define MB_YESNO
Definition: winuser.h:820
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1629
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2157
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define WM_SETTINGCHANGE
Definition: winuser.h:1632
#define RDW_ALLCHILDREN
Definition: winuser.h:1224
#define WM_TIMER
Definition: winuser.h:1745
#define IDC_APPSTARTING
Definition: winuser.h:699
struct tagNMHDR * LPNMHDR
#define HTCLIENT
Definition: winuser.h:2478
#define SendMessage
Definition: winuser.h:5855
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define LoadCursor
Definition: winuser.h:5824
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5731
#define MB_OK
Definition: winuser.h:793
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define WM_CHAR
Definition: winuser.h:1720
#define PostMessage
Definition: winuser.h:5844
#define CW_USEDEFAULT
Definition: winuser.h:225
HACCEL WINAPI LoadAcceleratorsW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define WM_SIZING
Definition: winuser.h:1810
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define MB_ICONQUESTION
Definition: winuser.h:792
int WINAPI TranslateAcceleratorW(_In_ HWND, _In_ HACCEL, _In_ LPMSG)
#define WM_SETCURSOR
Definition: winuser.h:1639
#define VK_SHIFT
Definition: winuser.h:2205
#define WM_DESTROY
Definition: winuser.h:1612
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDYES
Definition: winuser.h:838
#define SW_MAXIMIZE
Definition: winuser.h:775
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define DM_REPOSITION
Definition: winuser.h:2103
#define MAKEINTRESOURCE
Definition: winuser.h:591
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2127
#define RDW_INVALIDATE
Definition: winuser.h:1217
SHORT WINAPI GetKeyState(_In_ int)
#define COLOR_BTNFACE
Definition: winuser.h:931
HDWP WINAPI BeginDeferWindowPos(_In_ int)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2105
WCHAR * LPWSTR
Definition: xmlstorage.h:184