ReactOS 0.4.15-dev-8428-g6910fa6
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), bAppwizMode(bAppwiz), SelectedEnumType(ENUM_ALL_INSTALLED)
86{
87}
88
90{
92}
93
94VOID
96{
97 HTREEITEM hRootItemAvailable;
98
102
104
106 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_AUDIO, IDI_CAT_AUDIO);
107 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_VIDEO, IDI_CAT_VIDEO);
109 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_GAMES, IDI_CAT_GAMES);
112 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_DEVEL, IDI_CAT_DEVEL);
113 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_EDU, IDI_CAT_EDU);
117 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_TOOLS, IDI_CAT_TOOLS);
119 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_LIBS, IDI_CAT_LIBS);
121 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_OTHER, IDI_CAT_OTHER);
122
125 m_TreeView->Expand(hRootItemAvailable, TVE_EXPAND);
126 m_TreeView->SelectItem(bAppwizMode ? hRootItemInstalled : hRootItemAvailable);
127}
128
129BOOL
131{
136
138}
139
140BOOL
142{
147
148 return m_TreeView->Create(m_hWnd) != NULL;
149}
150
151BOOL
153{
154 m_ApplicationView = new CApplicationView(this); // pass this to ApplicationView for callback purpose
158
160}
161
162BOOL
164{
171
172 // TODO: m_MinSecond should be calculate dynamically instead of hard-coded
174 m_VSplitter->m_Pos = 240;
176
177 return m_VSplitter->Create(m_hWnd) != NULL;
178}
179
180BOOL
182{
183 BOOL b = TRUE;
184 bUpdating = TRUE;
185
186 m_ClientPanel = new CUiPanel();
189
190 // Top level
191 b = b && CreateStatusBar();
192 b = b && CreateVSplitter();
193
194 // Inside V Splitter
195 b = b && CreateTreeView();
197
198 if (b)
199 {
200 RECT rBottom;
201
202 /* Size status bar */
203 m_StatusBar->SendMessageW(WM_SIZE, 0, 0);
204
205 ::GetWindowRect(m_StatusBar->m_hWnd, &rBottom);
206
207 m_VSplitter->m_Margin.bottom = rBottom.bottom - rBottom.top;
208 }
209
211 return b;
212}
213
214VOID
216{
217 delete m_TreeView;
218 delete m_ApplicationView;
219 delete m_VSplitter;
220 delete m_StatusBar;
221 return;
222}
223
224BOOL
226{
227 if (CreateLayout())
228 {
231
232 return TRUE;
233 }
234
235 return FALSE;
236}
237
238VOID
240{
241 if (wParam == SIZE_MINIMIZED)
242 return;
243
244 /* Size status bar */
245 m_StatusBar->SendMessage(WM_SIZE, 0, 0);
246
247 RECT r = {0, 0, LOWORD(lParam), HIWORD(lParam)};
248 HDWP hdwp = NULL;
250
252 if (hdwp)
253 {
254 hdwp = m_ClientPanel->OnParentSize(r, hdwp);
255 if (hdwp)
256 {
257 EndDeferWindowPos(hdwp);
258 }
259 }
260}
261
262BOOL
264{
266 return FALSE;
267
268 CStringW szMsgText, szMsgTitle;
269
270 if (!szMsgText.LoadStringW(IDS_APP_REG_REMOVE) || !szMsgTitle.LoadStringW(IDS_INFORMATION))
271 return FALSE;
272
274 if (!InstalledApp)
275 return FALSE;
276
277 if (MessageBoxW(szMsgText, szMsgTitle, MB_YESNO | MB_ICONQUESTION) == IDYES)
278 return m_Db->RemoveInstalledAppFromRegistry(InstalledApp) == ERROR_SUCCESS;
279
280 return FALSE;
281}
282
283BOOL
285{
287 return FALSE;
288
290 if (!InstalledApp)
291 return FALSE;
292
293 return InstalledApp->UninstallApplication(bModify ? UCF_MODIFY : UCF_NONE);
294}
295
296VOID
298{
299 if (m_Db->GetAvailableCount() == 0)
300 {
303 }
304}
305
306BOOL
308{
309 theResult = 0;
310 switch (Msg)
311 {
312 case WM_CREATE:
313 if (!InitControls())
315 break;
316
317 case WM_DESTROY:
318 {
321
322 FreeLogs();
323
324 delete m_ClientPanel;
325
327 return 0;
328 }
329
330 case WM_COMMAND:
332 break;
333
334 case WM_NOTIFY:
335 {
337
338 switch (data->code)
339 {
340 case TVN_SELCHANGED:
341 {
342 if (data->hwndFrom == m_TreeView->m_hWnd)
343 {
344 switch (((LPNMTREEVIEW)lParam)->itemNew.lParam)
345 {
346 case IDS_INSTALLED:
348 break;
349
350 case IDS_APPLICATIONS:
352 break;
353
354 case IDS_UPDATES:
356 break;
357
360 break;
361
362 case IDS_CAT_AUDIO:
364 break;
365
366 case IDS_CAT_DEVEL:
368 break;
369
370 case IDS_CAT_DRIVERS:
372 break;
373
374 case IDS_CAT_EDU:
376 break;
377
378 case IDS_CAT_ENGINEER:
380 break;
381
382 case IDS_CAT_FINANCE:
384 break;
385
386 case IDS_CAT_GAMES:
388 break;
389
390 case IDS_CAT_GRAPHICS:
392 break;
393
394 case IDS_CAT_INTERNET:
396 break;
397
398 case IDS_CAT_LIBS:
400 break;
401
402 case IDS_CAT_OFFICE:
404 break;
405
406 case IDS_CAT_OTHER:
408 break;
409
410 case IDS_CAT_SCIENCE:
412 break;
413
414 case IDS_CAT_TOOLS:
416 break;
417
418 case IDS_CAT_VIDEO:
420 break;
421
422 case IDS_CAT_THEMES:
424 break;
425
428 break;
429 }
430 }
431 }
432 break;
433 }
434 }
435 break;
436
437 case WM_SIZE:
439 break;
440
441 case WM_SIZING:
442 {
443 LPRECT pRect = (LPRECT)lParam;
444
445 if (pRect->right - pRect->left < 565)
446 pRect->right = pRect->left + 565;
447
448 if (pRect->bottom - pRect->top < 300)
449 pRect->bottom = pRect->top + 300;
450
451 return TRUE;
452 }
453
455 {
456 /* Forward WM_SYSCOLORCHANGE to common controls */
458 m_TreeView->SendMessageW(WM_SYSCOLORCHANGE, wParam, lParam);
459 }
460 break;
461
462 case WM_SETTINGCHANGE:
463 if (wParam == SPI_SETNONCLIENTMETRICS || wParam == SPI_SETICONMETRICS)
464 {
466 g_hDefaultPackageIcon = NULL; // Trigger imagelist recreation on next load
467 }
468 break;
469
470 case WM_TIMER:
471 if (wParam == SEARCH_TIMER_ID)
472 {
474
476 }
477 break;
478 }
479
480 return FALSE;
481}
482
483VOID
485{
486 CStringW szApp;
487 CStringW szAuthors;
488
489 szApp.LoadStringW(IDS_APPTITLE);
490 szAuthors.LoadStringW(IDS_APP_AUTHORS);
491 ShellAboutW(m_hWnd, szApp, szAuthors,
493}
494
495VOID
497{
498 const BOOL bReload = TRUE;
499 WORD wCommand = LOWORD(wParam);
500
501 if (!lParam)
502 {
503 switch (wCommand)
504 {
505 case ID_SETTINGS:
507 break;
508
509 case ID_EXIT:
510 PostMessageW(WM_CLOSE, 0, 0);
511 break;
512
513 case ID_SEARCH:
515 break;
516
517 case ID_INSTALL:
519 {
520 if (!m_Selected.IsEmpty())
521 {
523 {
526 }
527 }
528 else
529 {
531 if (App)
532 {
534 }
535 }
536 }
537 break;
538
539 case ID_UNINSTALL:
542 break;
543
544 case ID_MODIFY:
547 break;
548
549 case ID_REGREMOVE:
552 break;
553
554 case ID_REFRESH:
556 break;
557
558 case ID_RESETDB:
561 break;
562
563 case ID_HELP:
564 MessageBoxW(L"Help not implemented yet", NULL, MB_OK);
565 break;
566
567 case ID_ABOUT:
568 ShowAboutDlg();
569 break;
570
571 case ID_CHECK_ALL:
573 break;
574
578 break;
579 }
580 }
581}
582
583VOID
585{
586 if (m_StatusBar)
587 {
588 CStringW szBuffer;
589
591 m_StatusBar->SetText(szBuffer);
592 }
593}
594
595VOID
597{
598 POSITION CurrentListPosition = List.GetHeadPosition();
599 while (CurrentListPosition)
600 {
601 CAppInfo *Info = List.GetNext(CurrentListPosition);
604 {
605 BOOL bSelected = m_Selected.Find(Info) != NULL;
607 }
608 }
609 m_ApplicationView->AddApplication(NULL, FALSE); // Tell the list we are done
610}
611
612VOID
614{
615 bUpdating = TRUE;
616
617 if (HCURSOR hCursor = LoadCursor(NULL, IDC_APPSTARTING))
618 {
619 // The database (.ini files) is parsed on the UI thread, let the user know we are busy
620 SetCursor(hCursor);
622 }
623
624 if (bCheckAvailable)
626
627 if (SelectedEnumType != EnumType)
628 SelectedEnumType = EnumType;
629
630 if (bReload)
632
634 if (IsInstalledEnum(EnumType))
635 {
636 if (bReload)
638
639 // set the display type of application-view. this will remove all the item in application-view too.
641
643 m_Db->GetApps(List, EnumType);
645 }
646 else if (IsAvailableEnum(EnumType))
647 {
648 if (bReload)
650
651 // set the display type of application-view. this will remove all the item in application-view too.
653
654 // enum available softwares
655 if (EnumType == ENUM_CAT_SELECTED)
656 {
658 }
659 else
660 {
662 m_Db->GetApps(List, EnumType);
664 }
665 }
666 else
667 {
668 ATLASSERT(0 && "This should be unreachable!");
669 }
671 m_ApplicationView->RedrawWindow(0, 0, RDW_INVALIDATE | RDW_ALLCHILDREN); // force the child window to repaint
673
676 {
677 text.LoadString(IDS_NO_SEARCH_RESULTS);
678 }
680
682}
683
686{
687 DWORD csStyle = CS_VREDRAW | CS_HREDRAW;
688 static ATL::CWndClassInfo wc = {
689 {sizeof(WNDCLASSEX), csStyle, StartWindowProc, 0, 0, NULL,
690 LoadIconW(_AtlBaseModule.GetModuleInstance(), MAKEINTRESOURCEW(IDI_MAIN)), LoadCursorW(NULL, IDC_ARROW),
692 NULL,
693 NULL,
694 IDC_ARROW,
695 TRUE,
696 0,
697 _T("")};
698 return wc;
699}
700
701HWND
703{
704 CStringW szWindowName;
705 szWindowName.LoadStringW(IDS_APPTITLE);
706
707 RECT r = {
711 r.right += r.left;
712 r.bottom += r.top;
713
714 return CWindowImpl::Create(
716}
717
718// this function is called when a item of application-view is checked/unchecked
719// CallbackParam is the param passed to application-view when adding the item (the one getting focus now).
720VOID
722{
723 if (bUpdating)
724 return;
725
726 CAppInfo *Info = (CAppInfo *)CallbackParam;
727
728 if (bChecked)
729 {
731 }
732 else
733 {
735 ATLASSERT(Pos != NULL);
736
737 if (Pos != NULL)
738 {
740 }
741 }
742
744}
745
746// this function is called when one or more application(s) should be installed
747// if Info is not zero, this app should be installed. otherwise those checked apps should be installed
748BOOL
750{
751 if (Info)
752 {
754 {
756 return TRUE;
757 }
758 }
759
760 return FALSE;
761}
762
763BOOL
765{
766 if (szSearchPattern == SearchText)
767 {
768 return FALSE;
769 }
770
771 szSearchPattern = SearchText;
772
773 DWORD dwDelay = 0;
774 SystemParametersInfoW(SPI_GETMENUSHOWDELAY, 0, &dwDelay, 0);
775 SetTimer(SEARCH_TIMER_ID, dwDelay);
776
777 return TRUE;
778}
779
780void
782{
783 ATL::CSimpleArray<HWND> TabOrderHwndList;
784
785 m_TreeView->AppendTabOrderWindow(direction, TabOrderHwndList);
786 m_ApplicationView->AppendTabOrderWindow(direction, TabOrderHwndList);
787
788 if (TabOrderHwndList.GetSize() == 0)
789 {
790 // in case the list is empty
791 return;
792 }
793
794 int FocusIndex;
795
796 if ((FocusIndex = TabOrderHwndList.Find(GetFocus())) == -1)
797 {
798 FocusIndex = 0; // focus the first window in the list
799 }
800 else
801 {
802 FocusIndex += direction;
803 FocusIndex +=
804 TabOrderHwndList.GetSize(); // FocusIndex might be negative. we don't want to mod a negative number
805 FocusIndex %= TabOrderHwndList.GetSize();
806 }
807
808 ::SetFocus(TabOrderHwndList[FocusIndex]);
809 return;
810}
811// **** CMainWindow ****
812
813VOID
815{
816 HACCEL KeyBrd;
817 MSG Msg;
818
819 hMainWnd = wnd->Create();
820 if (!hMainWnd)
821 return;
822
823 /* Maximize it if we must */
825 wnd->UpdateWindow();
826
827 /* Load the menu hotkeys */
829
830 /* Message Loop */
831 while (GetMessageW(&Msg, NULL, 0, 0))
832 {
833 if (!TranslateAcceleratorW(hMainWnd, KeyBrd, &Msg))
834 {
835 if (Msg.message == WM_CHAR && Msg.wParam == VK_TAB)
836 {
837 // Move backwards if shift is held down
838 int direction = (GetKeyState(VK_SHIFT) & 0x8000) ? -1 : 1;
839
840 wnd->HandleTabOrder(direction);
841 continue;
842 }
843
846 }
847 }
848}
#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 FreeLogs()
Definition: misc.cpp:215
INT GetSystemColorDepth()
Definition: misc.cpp:300
BOOL SearchPatternMatch(LPCWSTR szHaystack, LPCWSTR szNeedle)
Definition: misc.cpp:409
#define IDS_UPDATES
Definition: resource.h:100
#define IDS_CAT_TOOLS
Definition: resource.h:189
#define ID_REGREMOVE
Definition: resource.h:83
#define IDI_CAT_FINANCE
Definition: resource.h:25
#define IDS_CAT_VIDEO
Definition: resource.h:190
#define IDS_SELECTEDFORINST
Definition: resource.h:117
#define ID_UNINSTALL
Definition: resource.h:75
#define ID_SEARCH
Definition: resource.h:86
#define IDS_CAT_GRAPHICS
Definition: resource.h:183
#define IDI_SELECTEDFORINST
Definition: resource.h:16
#define IDI_CAT_EDU
Definition: resource.h:23
#define IDS_AVAILABLEFORINST
Definition: resource.h:99
#define IDI_CAT_INTERNET
Definition: resource.h:28
#define IDI_CAT_LIBS
Definition: resource.h:29
#define IDS_CAT_AUDIO
Definition: resource.h:176
#define IDS_INFORMATION
Definition: resource.h:106
#define IDS_APPS_COUNT
Definition: resource.h:94
#define IDS_CAT_SCIENCE
Definition: resource.h:188
#define IDS_CAT_ENGINEER
Definition: resource.h:180
#define IDI_CATEGORY
Definition: resource.h:13
#define IDI_CAT_OFFICE
Definition: resource.h:30
#define IDS_CAT_LIBS
Definition: resource.h:185
#define IDS_CAT_OTHER
Definition: resource.h:187
#define IDI_CAT_GRAPHICS
Definition: resource.h:27
#define ID_CHECK_ALL
Definition: resource.h:85
#define IDS_CAT_DEVEL
Definition: resource.h:177
#define IDI_APPS
Definition: resource.h:11
#define IDS_CAT_THEMES
Definition: resource.h:191
#define IDS_APP_AUTHORS
Definition: resource.h:120
#define IDI_CAT_SCIENCE
Definition: resource.h:32
#define IDI_CAT_OTHER
Definition: resource.h:31
#define IDS_CAT_GAMES
Definition: resource.h:182
#define ID_ACTIVATE_APPWIZ
Definition: resource.h:89
#define IDS_CAT_EDU
Definition: resource.h:179
#define ID_MODIFY
Definition: resource.h:78
#define IDS_CAT_INTERNET
Definition: resource.h:184
#define IDS_NO_SEARCH_RESULTS
Definition: resource.h:124
#define IDI_APPUPD
Definition: resource.h:12
#define IDI_CAT_VIDEO
Definition: resource.h:34
#define ID_RESETDB
Definition: resource.h:84
#define IDS_CAT_DRIVERS
Definition: resource.h:178
#define IDI_CAT_DRIVERS
Definition: resource.h:22
#define HOTKEYS
Definition: resource.h:235
#define IDI_CAT_DEVEL
Definition: resource.h:21
#define IDS_CAT_OFFICE
Definition: resource.h:186
#define IDS_CAT_FINANCE
Definition: resource.h:181
#define IDI_CAT_THEMES
Definition: resource.h:35
#define IDS_APP_REG_REMOVE
Definition: resource.h:105
#define IDI_CAT_GAMES
Definition: resource.h:26
#define IDS_APPLICATIONS
Definition: resource.h:101
#define IDI_CAT_ENGINEER
Definition: resource.h:24
#define IDS_INSTALLED
Definition: resource.h:98
#define IDI_CAT_TOOLS
Definition: resource.h:33
#define IDI_CAT_AUDIO
Definition: resource.h:20
#define ID_INSTALL
Definition: resource.h:74
#define ID_SETTINGS
Definition: resource.h:81
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:20
#define ID_ABOUT
Definition: charmap.c:17
bool IsEmpty() const
Definition: atlcoll.h:545
POSITION AddTail(INARGTYPE element)
Definition: atlcoll.h:626
void RemoveAll()
Definition: atlcoll.h:727
POSITION Find(INARGTYPE element, _In_opt_ POSITION posStartAfter=NULL) const
Definition: atlcoll.h:773
size_t GetCount() const
Definition: atlcoll.h:539
void RemoveAt(_In_ POSITION pos)
Definition: atlcoll.h:748
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 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:1962
HWND Create(HWND hwndParent)
Definition: appview.cpp:1896
BOOL AddApplication(CAppInfo *InstAppInfo, BOOL InitialCheckState)
Definition: appview.cpp:1944
BOOL SetDisplayAppType(APPLICATION_VIEW_TYPE AppType)
Definition: appview.cpp:1906
void SetFocusOnSearchBar()
Definition: appview.cpp:1700
void SetRedraw(BOOL bRedraw)
Definition: appview.cpp:1693
VOID AppendTabOrderWindow(int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
Definition: appview.cpp:1974
VOID SetWatermark(const CStringW &Text)
Definition: appview.cpp:1950
BOOL RemoveSelectedAppFromRegistry()
Definition: gui.cpp:263
AppsCategories SelectedEnumType
Definition: gui.h:64
HTREEITEM hRootItemInstalled
Definition: gui.h:61
VOID UpdateStatusBarText()
Definition: gui.cpp:584
BOOL CreateLayout()
Definition: gui.cpp:181
BOOL CreateTreeView()
Definition: gui.cpp:141
CSideTreeView * m_TreeView
Definition: gui.h:51
CStringW szSearchPattern
Definition: gui.h:63
CUiSplitPanel * m_VSplitter
Definition: gui.h:49
VOID AddApplicationsToView(CAtlList< CAppInfo * > &List)
Definition: gui.cpp:596
BOOL CreateVSplitter()
Definition: gui.cpp:163
BOOL SearchTextChanged(CStringW &SearchText)
Definition: gui.cpp:764
VOID CheckAvailable()
Definition: gui.cpp:297
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:613
static ATL::CWndClassInfo & GetWndClassInfo()
Definition: gui.cpp:685
BOOL bAppwizMode
Definition: gui.h:60
BOOL bUpdating
Definition: gui.h:59
~CMainWindow()
Definition: gui.cpp:89
CMainWindow()
Definition: main.h:30
void HandleTabOrder(int direction)
Definition: gui.cpp:781
BOOL InstallApplication(CAppInfo *Info)
Definition: gui.cpp:749
LRESULT OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: main.cpp:819
CAtlList< CAppInfo * > m_Selected
Definition: gui.h:57
VOID ShowAboutDlg()
Definition: gui.cpp:484
BOOL InitControls()
Definition: gui.cpp:225
VOID InitCategoriesList()
Definition: gui.cpp:95
VOID ItemCheckStateChanged(BOOL bChecked, LPVOID CallbackParam)
Definition: gui.cpp:721
CAppDB * m_Db
Definition: gui.h:56
CUiWindow< CStatusBar > * m_StatusBar
Definition: gui.h:52
HWND Create()
Definition: gui.cpp:702
BOOL ProcessWindowMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId)
Definition: gui.cpp:307
CUiPanel * m_ClientPanel
Definition: gui.h:48
VOID LayoutCleanup()
Definition: gui.cpp:215
BOOL CreateStatusBar()
Definition: gui.cpp:130
BOOL UninstallSelectedApp(BOOL bModify)
Definition: gui.cpp:284
BOOL CreateApplicationView()
Definition: gui.cpp:152
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 @1628 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 * text
Definition: package.c:1799
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:814
#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:84
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:3735
#define TVSIL_NORMAL
Definition: commctrl.h:3443
#define LPNMTREEVIEW
Definition: commctrl.h:3643
#define TVE_EXPAND
Definition: commctrl.h:3423
#define TVI_ROOT
Definition: commctrl.h:3368
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define ILC_MASK
Definition: commctrl.h:351
BOOL DownloadApplication(CAppInfo *pAppInfo)
Definition: loaddlg.cpp:1128
VOID CreateSettingsDlg(HWND hwnd)
BOOL DownloadListOfApplications(const CAtlList< CAppInfo * > &AppsList, BOOL bIsModal)
Definition: loaddlg.cpp:1109
#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:768
#define WM_CLOSE
Definition: winuser.h:1621
#define VK_TAB
Definition: winuser.h:2199
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:1608
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SIZE
Definition: winuser.h:1611
#define LR_CREATEDIBSECTION
Definition: winuser.h:1098
#define WM_COMMAND
Definition: winuser.h:1740
#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:2247
#define IDC_ARROW
Definition: winuser.h:687
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define WM_MOUSEMOVE
Definition: winuser.h:1775
#define SIZE_MINIMIZED
Definition: winuser.h:2506
#define MB_YESNO
Definition: winuser.h:817
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1626
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2149
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:1629
#define RDW_ALLCHILDREN
Definition: winuser.h:1221
#define WM_TIMER
Definition: winuser.h:1742
#define IDC_APPSTARTING
Definition: winuser.h:699
struct tagNMHDR * LPNMHDR
#define HTCLIENT
Definition: winuser.h:2475
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define LoadCursor
Definition: winuser.h:5821
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5728
#define MB_OK
Definition: winuser.h:790
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define WM_CHAR
Definition: winuser.h:1717
#define PostMessage
Definition: winuser.h:5841
#define CW_USEDEFAULT
Definition: winuser.h:225
HACCEL WINAPI LoadAcceleratorsW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define WM_SIZING
Definition: winuser.h:1807
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define MB_ICONQUESTION
Definition: winuser.h:789
int WINAPI TranslateAcceleratorW(_In_ HWND, _In_ HACCEL, _In_ LPMSG)
#define WM_SETCURSOR
Definition: winuser.h:1636
#define VK_SHIFT
Definition: winuser.h:2202
#define WM_DESTROY
Definition: winuser.h:1609
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDYES
Definition: winuser.h:835
#define SW_MAXIMIZE
Definition: winuser.h:772
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define MAKEINTRESOURCE
Definition: winuser.h:591
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2119
#define RDW_INVALIDATE
Definition: winuser.h:1214
SHORT WINAPI GetKeyState(_In_ int)
#define COLOR_BTNFACE
Definition: winuser.h:928
HDWP WINAPI BeginDeferWindowPos(_In_ int)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2097
WCHAR * LPWSTR
Definition: xmlstorage.h:184