ReactOS 0.4.16-dev-974-g5022a45
appview.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: Application view class and other classes used by it
5 * COPYRIGHT: Copyright 2020 He Yang (1160386205@qq.com)
6 * Copyright 2022,2023 Mark Jansen <mark.jansen@reactos.org>
7 */
8
9#include "rapps.h"
10#include "appview.h"
11#include "gui.h"
12#include <windowsx.h>
13
14using namespace Gdiplus;
15
19
20// **** Menu helpers ****
21
22BOOL
24 _In_ HMENU hMenu,
25 _In_ UINT uPosition,
27{
28 INT pos;
29 MENUITEMINFOW mii = { sizeof(mii), MIIM_FTYPE, 0 };
30 bool bIsValidItem1, bIsValidItem2;
31 bool bIsSep1, bIsSep2;
32
34 pos = (INT)uPosition;
35 else
36 pos = ::GetMenuPosFromID(hMenu, uPosition);
37 if (pos < 0)
38 return FALSE;
39
40 bIsValidItem1 = ((pos > 0) && ::GetMenuItemInfoW(hMenu, pos - 1, TRUE, &mii));
41 bIsSep1 = bIsValidItem1 && !!(mii.fType & MFT_SEPARATOR);
42
43 bIsValidItem2 = ::GetMenuItemInfoW(hMenu, pos + 1, TRUE, &mii);
44 bIsSep2 = bIsValidItem2 && !!(mii.fType & MFT_SEPARATOR);
45
46 if (bIsSep1 && !bIsSep2 && !bIsValidItem2)
47 pos = pos - 1; // Delete separator only if pos+1 has no item
48 else if (!bIsSep1 && bIsSep2 && !bIsValidItem1)
49 pos = pos + 1; // Delete separator only if pos-1 has no item
50 else if (bIsSep1 && bIsSep2)
51 pos = pos + 1;
52 else
53 pos = -1;
54
55 // Delete one of the separators if necessary
56 if (pos != -1)
58
59 // Finally, delete the menu item itself.
60 return ::DeleteMenu(hMenu, uPosition, uFlags);
61}
62// **** Menu helpers ****
63
64// **** CMainToolbar ****
65
66VOID
68{
69 HICON hImage;
70
71 if (!(hImage =
73 {
74 return;
75 }
76
77 ImageList_AddIcon(hImageList, hImage);
78 DeleteObject(hImage);
79}
80
83{
84 HIMAGELIST hImageList;
85
86 /* Create the toolbar icon image list */
88 if (!hImageList)
89 {
90 return NULL;
91 }
92
100 AddImageToImageList(hImageList, IDI_EXIT);
101
102 return hImageList;
103}
104
105CMainToolbar::CMainToolbar() : m_iToolbarHeight(24), m_dButtonsWidthMax(0)
106{
107}
108
109VOID
111{
112 UINT idButton = (UINT)lpttt->hdr.idFrom;
113
114 switch (idButton)
115 {
116 case ID_EXIT:
117 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_EXIT);
118 break;
119
120 case ID_INSTALL:
121 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_INSTALL);
122 break;
123
124 case ID_UNINSTALL:
125 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_UNINSTALL);
126 break;
127
128 case ID_MODIFY:
129 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_MODIFY);
130 break;
131
132 case ID_SETTINGS:
133 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_SETTINGS);
134 break;
135
136 case ID_REFRESH:
137 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_REFRESH);
138 break;
139
140 case ID_RESETDB:
141 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_UPDATE_DB);
142 break;
143 }
144}
145
146HWND
148{
149 CStringW szInstallBtn;
150 CStringW szUninstallBtn;
151 CStringW szModifyBtn;
152 CStringW szSelectAllBtn;
153 CStringW szRefreshBtn;
154 CStringW szUpdateDbBtn;
155
156 /* Load tooltip strings */
157 szInstallBtn.LoadStringW(IDS_TOOLTIP_INSTALL);
158 szUninstallBtn.LoadStringW(IDS_TOOLTIP_UNINSTALL);
159 szModifyBtn.LoadStringW(IDS_TOOLTIP_MODIFY);
160 szSelectAllBtn.LoadStringW(IDS_TOOLTIP_SELECT_ALL);
161 szRefreshBtn.LoadStringW(IDS_TOOLTIP_REFRESH);
162 szUpdateDbBtn.LoadStringW(IDS_TOOLTIP_UPDATE_DB);
163
164 /* Create buttons */
165 TBBUTTON Buttons[] = {
166 /* iBitmap, idCommand, fsState, fsStyle, bReserved[2], dwData, iString */
167 {0, ID_INSTALL, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, {0}, 0, (INT_PTR)szInstallBtn.GetString()},
168 {1, ID_UNINSTALL, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, {0}, 0, (INT_PTR)szUninstallBtn.GetString()},
169 {2, ID_MODIFY, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, {0}, 0, (INT_PTR)szModifyBtn.GetString()},
170 {3, ID_CHECK_ALL, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, {0}, 0, (INT_PTR)szSelectAllBtn.GetString()},
171 {-1, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0},
172 {4, ID_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, {0}, 0, (INT_PTR)szRefreshBtn.GetString()},
173 {5, ID_RESETDB, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, {0}, 0, (INT_PTR)szUpdateDbBtn.GetString()}};
174
175 m_hWnd = CreateWindowExW(
177 hwndParent, 0, hInst, NULL);
178
179 if (!m_hWnd)
180 {
181 return FALSE;
182 }
183
186
187 /* Set image list */
188 HIMAGELIST hImageList = InitImageList();
189
190 if (hImageList)
191 {
192 ImageList_Destroy(SetImageList(hImageList));
193 }
194
196
197 /* Remember the ideal width to use as a max width of buttons */
199
200 return m_hWnd;
201}
202
203void
205{
206 DWORD dCurrentExStyle = (DWORD)SendMessageW(TB_GETEXTENDEDSTYLE, 0, 0);
207 if (bShow)
209 else
211}
212
213void
215{
216 SIZE size;
219}
220
221DWORD
223{
224 return m_dButtonsWidthMax;
225}
226// **** CMainToolbar ****
227
228// **** CSearchBar ****
229
230CSearchBar::CSearchBar() : m_Width(180), m_Height(22)
231{
232}
233
234VOID
236{
238}
239
240HWND
242{
243 CStringW szBuf;
246 hwndParent, (HMENU)NULL, hInst, 0);
247
249 szBuf.LoadStringW(IDS_SEARCH_TEXT);
250 SetWindowTextW(szBuf);
251 return m_hWnd;
252}
253// **** CSearchBar ****
254
255// **** CComboBox ****
256
257CComboBox::CComboBox() : m_Width(80), m_Height(22)
258{
259}
260
261HWND
263{
267
269
270 for (int i = 0; i < (int)_countof(m_TypeStringID); i++)
271 {
272 CStringW szBuf;
273 szBuf.LoadStringW(m_TypeStringID[i]);
275 }
276
277 SendMessageW(CB_SETCURSEL, m_DefaultSelectType, 0); // select the first item
278
279 return m_hWnd;
280}
281// **** CComboBox ****
282
283// **** CAppRichEdit ****
284
285VOID
286CAppRichEdit::LoadAndInsertText(UINT uStringID, const CStringW &szText, DWORD TextFlags)
287{
288 CStringW szLoadedText;
289 if (!szText.IsEmpty() && szLoadedText.LoadStringW(uStringID))
290 {
291 const DWORD StringFlags = CFE_BOLD;
292 InsertText(szLoadedText, StringFlags);
293 InsertText(szText, TextFlags);
294 }
295}
296
297VOID
299{
300 CStringW szLoadedText;
301 if (szLoadedText.LoadStringW(uStringID))
302 {
303 InsertText(L"\n", 0);
304 InsertText(szLoadedText, StringFlags);
305 InsertText(L"\n", 0);
306 }
307}
308
309VOID
311{
312 if (!Text.IsEmpty())
313 {
314 LoadAndInsertText(StringID, Text, TextFlags);
315 }
316}
317// **** CAppRichEdit ****
318
319int
321{
323 switch (Event)
324 {
325 case ASYNCINET_DATA:
327 WriteFile(DownloadParam->hFile, (LPCVOID)wParam, (DWORD)lParam, &BytesWritten, NULL);
328 break;
330 CloseHandle(DownloadParam->hFile);
332 DownloadParam->hwndNotify, WM_RAPPS_DOWNLOAD_COMPLETE, (WPARAM)ERROR_SUCCESS, (LPARAM)DownloadParam);
333 break;
335 CloseHandle(DownloadParam->hFile);
337 DownloadParam->hwndNotify, WM_RAPPS_DOWNLOAD_COMPLETE, (WPARAM)ERROR_CANCELLED, (LPARAM)DownloadParam);
338 break;
339 case ASYNCINET_ERROR:
340 CloseHandle(DownloadParam->hFile);
341 SendMessage(DownloadParam->hwndNotify, WM_RAPPS_DOWNLOAD_COMPLETE, wParam, (LPARAM)DownloadParam);
342 break;
343 default:
345 break;
346 }
347 return 0;
348}
349
350// **** CAppScrnshotPreview ****
351
352CAppScrnshotPreview::CAppScrnshotPreview(const CStringW &BasePath) : m_BasePath(BasePath)
353{
354}
355
356BOOL
358 HWND hwnd,
359 UINT Msg,
362 LRESULT &theResult,
363 DWORD dwMapId)
364{
365 theResult = 0;
366 switch (Msg)
367 {
368 case WM_CREATE:
371 break;
372 case WM_SIZE:
373 {
375 {
377
378 if (hBrokenImgIcon)
379 {
383 }
384 }
385 break;
386 }
388 {
391 AsyncInet = NULL;
392 switch (wParam)
393 {
394 case ERROR_SUCCESS:
395 if (ContentID == DownloadParam->ID)
396 {
397 DisplayFile(DownloadParam->DownloadFileName);
398 // send a message to trigger resizing
400 InvalidateRect(0, 0);
402 DownloadParam->DownloadFileName; // record tmp file path in order to delete it when cleanup
403 }
404 else
405 {
406 // the picture downloaded is already outdated. delete it.
407 DeleteFileW(DownloadParam->DownloadFileName);
408 }
409 break;
410 case ERROR_CANCELLED:
411 DeleteFileW(DownloadParam->DownloadFileName);
412 break;
413 default:
415 // send a message to trigger resizing
417 InvalidateRect(0, 0);
418 DeleteFileW(DownloadParam->DownloadFileName);
419 break;
420 }
421 delete DownloadParam;
422 break;
423 }
424 case WM_PAINT:
425 {
426 PAINTSTRUCT ps;
427 HDC hdc = BeginPaint(&ps);
428 CRect rect;
430
431 PaintOnDC(hdc, rect.Width(), rect.Height(), ps.fErase);
432
433 EndPaint(&ps);
434 break;
435 }
436 case WM_PRINTCLIENT:
437 {
439 {
440 if (!IsWindowVisible())
441 break;
442 }
443 CRect rect;
445
446 PaintOnDC((HDC)wParam, rect.Width(), rect.Height(), lParam & PRF_ERASEBKGND);
447 break;
448 }
449 case WM_ERASEBKGND:
450 {
451 return TRUE; // do not erase to avoid blinking
452 }
453 case WM_TIMER:
454 {
455 switch (wParam)
456 {
460 HDC hdc = GetDC();
461 CRect rect;
463
464 PaintOnDC(hdc, rect.Width(), rect.Height(), TRUE);
465 ReleaseDC(hdc);
466 }
467 break;
468 }
469 case WM_DESTROY:
470 {
474 break;
475 }
476 }
477 return FALSE;
478}
479
480VOID
482{
484 if (bLoadingTimerOn)
485 {
487 }
491}
492
493VOID
495{
499}
500
501BOOL
503{
506 pImage = Bitmap::FromFile(lpszFileName, 0);
507 if (pImage->GetLastStatus() != Ok)
508 {
510 return FALSE;
511 }
512 return TRUE;
513}
514
515VOID
517{
519}
520
521VOID
523{
524 // use an off screen dc to avoid blinking
528
529 if (bDrawBkgnd)
530 {
531 HBRUSH hOldBrush = (HBRUSH)SelectObject(hdcMem, (HGDIOBJ)GetSysColorBrush(COLOR_BTNFACE));
532 PatBlt(hdcMem, 0, 0, width, height, PATCOPY);
533 SelectObject(hdcMem, hOldBrush);
534 }
535
536 switch (ScrnshotPrevStauts)
537 {
539 {
540 }
541 break;
542
544 {
545 Graphics graphics(hdcMem);
546 Color color(255, 0, 0);
547 SolidBrush dotBrush(Color(255, 100, 100, 100));
548
549 graphics.SetSmoothingMode(SmoothingMode::SmoothingModeAntiAlias);
550
551 // Paint three dot
552 float DotWidth = GetLoadingDotWidth(width, height);
553 graphics.FillEllipse(
554 (Brush *)(&dotBrush), (REAL)width / 2.0 - min(width, height) * 2.0 / 16.0 - DotWidth / 2.0,
555 (REAL)height / 2.0 -
557 DotWidth, DotWidth);
558
559 graphics.FillEllipse(
560 (Brush *)(&dotBrush), (REAL)width / 2.0 - DotWidth / 2.0,
561 (REAL)height / 2.0 - GetFrameDotShift(LoadingAnimationFrame, width, height) - DotWidth / 2.0, DotWidth,
562 DotWidth);
563
564 graphics.FillEllipse(
565 (Brush *)(&dotBrush), (REAL)width / 2.0 + min(width, height) * 2.0 / 16.0 - DotWidth / 2.0,
566 (REAL)height / 2.0 -
568 DotWidth, DotWidth);
569 }
570 break;
571
573 {
574 if (pImage)
575 {
576 // always draw entire image inside the window.
577 Graphics graphics(hdcMem);
578 float ZoomRatio =
579 min(((float)width / (float)pImage->GetWidth()), ((float)height / (float)pImage->GetHeight()));
580 float ZoomedImgWidth = ZoomRatio * (float)pImage->GetWidth();
581 float ZoomedImgHeight = ZoomRatio * (float)pImage->GetHeight();
582
583 graphics.DrawImage(
584 pImage, ((float)width - ZoomedImgWidth) / 2.0, ((float)height - ZoomedImgHeight) / 2.0,
585 ZoomedImgWidth, ZoomedImgHeight);
586 }
587 }
588 break;
589
591 {
595 }
596 break;
597 }
598
599 // copy the content form off-screen dc to hdc
600 BitBlt(hdc, 0, 0, width, height, hdcMem, 0, 0, SRCCOPY);
603}
604
605float
607{
608 return min(width, height) / 20.0;
609}
610
611float
613{
614 return min(width, height) * (1.0 / 16.0) * (2.0 / (2.0 - sqrt(3.0))) *
615 (max(sin((float)Frame * 2 * PI / (LOADING_ANIMATION_PERIOD * LOADING_ANIMATION_FPS)), sqrt(3.0) / 2.0) -
616 sqrt(3.0) / 2.0);
617}
618
621{
622 DWORD csStyle = CS_VREDRAW | CS_HREDRAW;
623 static ATL::CWndClassInfo wc = {
624 {sizeof(WNDCLASSEX), csStyle, StartWindowProc, 0, 0, NULL, 0, LoadCursorW(NULL, IDC_ARROW),
625 (HBRUSH)(COLOR_BTNFACE + 1), 0, L"RAppsScrnshotPreview", NULL},
626 NULL,
627 NULL,
628 IDC_ARROW,
629 TRUE,
630 0,
631 _T("")};
632 return wc;
633}
634
635HWND
637{
638 RECT r = {0, 0, 0, 0};
639
640 return CWindowImpl::Create(hParent, r, L"", WS_CHILD | WS_VISIBLE);
641}
642
643VOID
645{
646 if (bLoadingTimerOn)
647 {
650 }
652 if (pImage)
653 {
654 delete pImage;
655 pImage = NULL;
656 }
657 if (AsyncInet)
658 {
660 }
661 if (!TempImagePath.IsEmpty())
662 {
665 }
666}
667
668VOID
670{
674}
675
676BOOL
678{
681
682 if (PathIsURLW(lpszLocation))
683 {
685
686 ScrnshotDownloadParam *DownloadParam = new ScrnshotDownloadParam;
687 if (!DownloadParam)
688 return FALSE;
689
690 DownloadParam->hwndNotify = m_hWnd;
691 DownloadParam->ID = ID;
692 // generate a filename
693 CStringW ScrnshotFolder = m_BasePath;
694 PathAppendW(ScrnshotFolder.GetBuffer(MAX_PATH), L"screenshots");
695 ScrnshotFolder.ReleaseBuffer();
696
697 if (!PathIsDirectoryW(ScrnshotFolder.GetString()))
698 {
699 CreateDirectoryW(ScrnshotFolder.GetString(), NULL);
700 }
701
702 if (!GetTempFileNameW(
703 ScrnshotFolder.GetString(), L"img", 0, DownloadParam->DownloadFileName.GetBuffer(MAX_PATH)))
704 {
705 DownloadParam->DownloadFileName.ReleaseBuffer();
706 delete DownloadParam;
708 return FALSE;
709 }
710 DownloadParam->DownloadFileName.ReleaseBuffer();
711
712 DownloadParam->hFile = CreateFileW(
714 NULL);
715 if (DownloadParam->hFile == INVALID_HANDLE_VALUE)
716 {
717 delete DownloadParam;
719 return FALSE;
720 }
721
723 0, INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, lpszLocation, TRUE, ScrnshotDownloadCallback, DownloadParam);
724 if (!AsyncInet)
725 {
726 CloseHandle(DownloadParam->hFile);
727 DeleteFileW(DownloadParam->DownloadFileName.GetBuffer());
728 delete DownloadParam;
730 return FALSE;
731 }
732 return TRUE;
733 }
734 else
735 {
736 return DisplayFile(lpszLocation);
737 }
738}
739
740int
741CAppScrnshotPreview::GetRequestedWidth(int Height) // calculate requested window width by given height
742{
743 switch (ScrnshotPrevStauts)
744 {
746 return 0;
748 return 200;
750 if (pImage)
751 {
752 // return the width needed to display image inside the window.
753 // and always keep window w/h ratio inside [ 1/SCRNSHOT_MAX_ASPECT_RAT, SCRNSHOT_MAX_ASPECT_RAT ]
754 return (int)floor(
755 (float)Height *
756 max(min((float)pImage->GetWidth() / (float)pImage->GetHeight(), (float)SCRNSHOT_MAX_ASPECT_RAT),
757 1.0 / (float)SCRNSHOT_MAX_ASPECT_RAT));
758 }
759 return 0;
761 return 200;
762 default:
763 return 0;
764 }
765}
766
768{
770}
771// **** CAppScrnshotPreview ****
772
773// **** CAppInfoDisplay ****
774
775BOOL
777 HWND hwnd,
781 LRESULT &theResult,
782 DWORD dwMapId)
783{
784 theResult = 0;
785 switch (message)
786 {
787 case WM_CREATE:
788 {
789 RichEdit = new CAppRichEdit();
791
796 break;
797 }
798 case WM_SIZE:
799 {
801 break;
802 }
804 {
806 break;
807 }
808 case WM_COMMAND:
809 {
811 break;
812 }
813 case WM_NOTIFY:
814 {
815 NMHDR *NotifyHeader = (NMHDR *)lParam;
816 if (NotifyHeader->hwndFrom == RichEdit->m_hWnd)
817 {
818 switch (NotifyHeader->code)
819 {
820 case EN_LINK:
821 OnLink((ENLINK *)lParam);
822 break;
823 }
824 }
825 break;
826 }
828 {
830 break;
831 }
832 }
833
834 return FALSE;
835}
836
837VOID
839{
840 CRect rect;
842 ResizeChildren(rect.Width(), rect.Height());
843}
844
845VOID
847{
848 int ScrnshotWidth = ScrnshotPrev->GetRequestedWidth(Height);
849
850 // make sure richedit always have room to display
851 ScrnshotWidth = min(ScrnshotWidth, Width - INFO_DISPLAY_PADDING - RICHEDIT_MIN_WIDTH);
852
853 DWORD dwError = ERROR_SUCCESS;
854 HDWP hDwp = BeginDeferWindowPos(2);
855
856 if (hDwp)
857 {
858 hDwp = ::DeferWindowPos(hDwp, ScrnshotPrev->m_hWnd, NULL, 0, 0, ScrnshotWidth, Height, 0);
859
860 if (hDwp)
861 {
862 // hide the padding if scrnshot window width == 0
863 int RicheditPosX = ScrnshotWidth ? (ScrnshotWidth + INFO_DISPLAY_PADDING) : 0;
864
865 hDwp = ::DeferWindowPos(hDwp, RichEdit->m_hWnd, NULL, RicheditPosX, 0, Width - RicheditPosX, Height, 0);
866
867 if (hDwp)
868 {
869 EndDeferWindowPos(hDwp);
870 }
871 else
872 {
873 dwError = GetLastError();
874 }
875 }
876 else
877 {
878 dwError = GetLastError();
879 }
880 }
881 else
882 {
883 dwError = GetLastError();
884 }
885
886#if DBG
887 ATLASSERT(dwError == ERROR_SUCCESS);
888#endif
889 UNREFERENCED_PARAMETER(dwError);
890
891 UpdateWindow();
892}
893
894VOID
896{
897 switch (Link->msg)
898 {
899 case WM_LBUTTONUP:
900 case WM_RBUTTONUP:
901 {
902 if (pLink)
904
906 GetProcessHeap(), 0,
907 (max(Link->chrg.cpMin, Link->chrg.cpMax) - min(Link->chrg.cpMin, Link->chrg.cpMax) + 1) *
908 sizeof(WCHAR));
909 if (!pLink)
910 {
911 /* TODO: Error message */
912 return;
913 }
914
915 RichEdit->SendMessageW(EM_SETSEL, Link->chrg.cpMin, Link->chrg.cpMax);
916 RichEdit->SendMessageW(EM_GETSELTEXT, 0, (LPARAM)pLink);
917
918 ShowPopupMenuEx(m_hWnd, m_hWnd, IDR_LINKMENU, -1);
919 }
920 break;
921 }
922}
923
926{
927 DWORD csStyle = CS_VREDRAW | CS_HREDRAW;
928 static ATL::CWndClassInfo wc = {/*.m_wc=*/
929 {/*cbSize=*/sizeof(WNDCLASSEX),
930 /*style=*/csStyle,
931 /*lpfnWndProc=*/StartWindowProc,
932 /*cbClsExtra=*/0,
933 /*cbWndExtra=*/0,
934 /*hInstance=*/NULL,
935 /*hIcon=*/NULL,
936 /*hCursor*/ NULL,
937 /*hbrBackground=*/(HBRUSH)(COLOR_BTNFACE + 1),
938 /*lpszMenuName=*/NULL,
939 /*lpszClassName=*/L"RAppsAppInfo",
940 /*hIconSm=*/NULL},
941 /*m_lpszOrigName=*/NULL,
942 /*pWndProc=*/NULL,
943 /*m_lpszCursorID=*/IDC_ARROW,
944 /*m_bSystemCursor*/ TRUE,
945 /*m_atom=*/0,
946 /*m_szAutoName=*/_T("")};
947 return wc;
948}
949
950HWND
952{
953 RECT r = {0, 0, 0, 0};
954
956}
957
958VOID
960{
961 if (!OnlyUpdateText)
962 {
963 CStringW ScrnshotLocation;
964 if (Info.RetrieveScreenshot(ScrnshotLocation))
965 {
966 ScrnshotPrev->DisplayImage(ScrnshotLocation);
967 }
968 else
969 {
971 }
972 }
974 Info.ShowAppInfo(RichEdit);
975}
976
977void
979{
980 CStringW szText;
981
984
985 // Display the standard banner in normal mode, or
986 // the specific "Add/Remove Programs" in APPWIZ-mode.
987 if (!bAppwiz)
988 {
989 szText.LoadStringW(IDS_WELCOME_TITLE);
990 RichEdit->SetText(szText, CFE_BOLD);
991 RichEdit->InsertText(L"\n\n", 0);
992
993 szText.LoadStringW(IDS_WELCOME_TEXT);
994 RichEdit->InsertText(szText, 0);
995
996 szText.LoadStringW(IDS_WELCOME_URL);
997 RichEdit->InsertText(szText, CFM_LINK);
998 }
999 else
1000 {
1001 szText.LoadStringW(IDS_APPWIZ_TITLE);
1002 RichEdit->SetText(szText, CFE_BOLD);
1003 RichEdit->InsertText(L"\n\n", 0);
1004
1005 szText.LoadStringW(IDS_APPWIZ_TEXT1);
1006 RichEdit->InsertText(szText, 0);
1007 RichEdit->InsertText(L"\n", 0);
1008
1009 szText.LoadStringW(IDS_APPWIZ_TEXT2);
1010 RichEdit->InsertText(szText, 0);
1011 }
1012}
1013
1014VOID
1016{
1017 WORD wCommand = LOWORD(wParam);
1018
1019 switch (wCommand)
1020 {
1021 case ID_OPEN_LINK:
1022
1023 ShellExecuteW(m_hWnd, L"open", pLink, NULL, NULL, SW_SHOWNOACTIVATE);
1025 pLink = NULL;
1026 break;
1027
1028 case ID_COPY_LINK:
1031 pLink = NULL;
1032 break;
1033 }
1034}
1035
1037{
1038 delete RichEdit;
1039 delete ScrnshotPrev;
1040}
1041// **** CAppInfoDisplay ****
1042
1043// **** CAppsListView ****
1044
1048 CAppInfo *AppInfo; // Only used to find the item in the list, do not access on background thread
1050 bool Parse;
1052
1053 void Free() { free(this); }
1055 static void StartTasks();
1058
1059static DWORD CALLBACK
1061{
1062 for (CAsyncLoadIcon *task = (CAsyncLoadIcon*)Param, *old; task; old->Free())
1063 {
1064 if (task->TaskId == g_AsyncIconTaskId)
1065 {
1066 HICON hIcon;
1067 HICON *phBigIcon = SettingsInfo.bSmallIcons ? NULL : &hIcon;
1068 HICON *phSmallIcon = phBigIcon ? NULL : &hIcon;
1069 if (!task->Parse)
1071 else if (!ExtractIconExW(task->Location, PathParseIconLocationW(task->Location), phBigIcon, phSmallIcon, 1))
1072 hIcon = NULL;
1073
1074 if (hIcon)
1075 {
1076 SendMessageW(task->hAppsList, WM_RAPPSLIST_ASYNCICON, (WPARAM)hIcon, (LPARAM)task);
1078 }
1079 }
1080 old = task;
1081 task = task->pNext;
1082 }
1083 return 0;
1084}
1085
1087CAsyncLoadIcon::Queue(HWND hAppsList, CAppInfo &AppInfo, bool Parse)
1088{
1090 CStringW szIconPath;
1091 if (!AppInfo.RetrieveIcon(szIconPath))
1092 return NULL;
1093 SIZE_T cbstr = (szIconPath.GetLength() + 1) * sizeof(WCHAR);
1094 CAsyncLoadIcon *task = (CAsyncLoadIcon*)malloc(sizeof(CAsyncLoadIcon) + cbstr);
1095 if (!task)
1096 return NULL;
1097 task->hAppsList = hAppsList;
1098 task->AppInfo = &AppInfo;
1099 task->TaskId = g_AsyncIconTaskId;
1100 task->Parse = Parse;
1101 CopyMemory(task->Location, szIconPath.GetBuffer(), cbstr);
1102 szIconPath.ReleaseBuffer();
1103 task->pNext = g_AsyncIconTasks;
1104 g_AsyncIconTasks = task;
1105 return task;
1106}
1107
1108void
1110{
1113 if (HANDLE hThread = CreateThread(NULL, 0, AsyncLoadIconProc, tasks, 0, NULL))
1115 else
1116 AsyncLoadIconProc(tasks); // Insist so we at least free the tasks
1117}
1118
1120{
1121 m_hImageListView = 0;
1122}
1123
1125{
1126 if (m_hImageListView)
1130}
1131
1132LRESULT
1134{
1135 LRESULT lRes = this->DefWindowProc(uMsg, wParam, lParam);
1136 if (!m_Watermark.IsEmpty())
1137 {
1138 RECT rc;
1139 GetClientRect(&rc);
1145 SelectFont(HDC(wParam), oldFont);
1146 }
1147 return lRes;
1148}
1149
1150LRESULT
1152{
1154 bHandled = TRUE;
1155 if (task->TaskId == g_AsyncIconTaskId)
1156 {
1157 LVITEM lvi;
1158 LVFINDINFO lvfi;
1159 lvfi.flags = LVFI_PARAM;
1160 lvfi.lParam = (LPARAM)task->AppInfo;
1161 lvi.iItem = ListView_FindItem(m_hWnd, -1, &lvfi);
1162 if (lvi.iItem != -1)
1163 {
1165 if (lvi.iImage != -1)
1166 {
1167 lvi.mask = LVIF_IMAGE;
1168 lvi.iSubItem = 0;
1169 ListView_SetItem(m_hWnd, &lvi);
1170 }
1171 }
1172 }
1173 return 0;
1174}
1175
1176VOID
1178{
1179 m_Watermark = Text;
1180}
1181
1182void
1184{
1185 SetExtendedListViewStyle((bShow ? LVS_EX_CHECKBOXES : 0) | LVS_EX_FULLROWSELECT);
1186 bHasCheckboxes = bShow;
1187}
1188
1189VOID
1191{
1192 HWND hHeader;
1193 HDITEMW hColumn;
1194 INT nHeaderID = pnmv->iSubItem;
1195
1197 return;
1198
1199 hHeader = (HWND)SendMessage(LVM_GETHEADER, 0, 0);
1200 ZeroMemory(&hColumn, sizeof(hColumn));
1201
1202 /* If the sorting column changed, remove the sorting style from the old column */
1203 if ((nLastHeaderID != -1) && (nLastHeaderID != nHeaderID))
1204 {
1205 bIsAscending = TRUE; // also reset sorting method to ascending
1206 hColumn.mask = HDI_FORMAT;
1207 Header_GetItem(hHeader, nLastHeaderID, &hColumn);
1208 hColumn.fmt &= ~(HDF_SORTUP | HDF_SORTDOWN);
1209 Header_SetItem(hHeader, nLastHeaderID, &hColumn);
1210 }
1211
1212 /* Set the sorting style to the new column */
1213 hColumn.mask = HDI_FORMAT;
1214 Header_GetItem(hHeader, nHeaderID, &hColumn);
1215
1216 hColumn.fmt &= ~(HDF_SORTDOWN | HDF_SORTUP);
1217 hColumn.fmt |= (bIsAscending ? HDF_SORTUP : HDF_SORTDOWN);
1218 Header_SetItem(hHeader, nHeaderID, &hColumn);
1219
1220 /* Sort the list, using the current values of nHeaderID and bIsAscending */
1221 SortContext ctx = {this, nHeaderID};
1222 SortItems(s_CompareFunc, &ctx);
1223
1224 /* Save new values */
1225 nLastHeaderID = nHeaderID;
1227}
1228
1229BOOL
1231{
1232 LVCOLUMNW Column;
1233
1234 ZeroMemory(&Column, sizeof(Column));
1235
1237 Column.iSubItem = Index;
1238 Column.pszText = const_cast<LPWSTR>(Text.GetString());
1239 Column.cx = Width;
1240 Column.fmt = Format;
1241
1242 return SendMessage(LVM_INSERTCOLUMN, Index, (LPARAM)(&Column));
1243}
1244
1245void
1247{
1249 return;
1250}
1251
1252INT
1254{
1255 LVITEMW Item;
1256
1257 ZeroMemory(&Item, sizeof(Item));
1258
1260 Item.pszText = const_cast<LPWSTR>(lpText);
1261 Item.lParam = lParam;
1262 Item.iItem = ItemIndex;
1263 Item.iImage = IconIndex;
1264
1265 if (IconIndex >= 0)
1266 {
1267 Item.iImage = IconIndex;
1268 Item.mask |= LVIF_IMAGE;
1269 }
1270 return InsertItem(&Item);
1271}
1272
1275{
1276 return (HIMAGELIST)SendMessage(LVM_GETIMAGELIST, iImageList, 0);
1277}
1278
1281{
1282 SortContext *ctx = ((SortContext *)lParamSort);
1283 return ctx->lvw->CompareFunc(lParam1, lParam2, ctx->iSubItem);
1284}
1285
1286INT
1287CAppsListView::CompareFunc(LPARAM lParam1, LPARAM lParam2, INT iSubItem)
1288{
1289 CStringW Item1, Item2;
1290 LVFINDINFOW IndexInfo;
1291 INT Index;
1292
1293 IndexInfo.flags = LVFI_PARAM;
1294
1295 IndexInfo.lParam = lParam1;
1296 Index = FindItem(-1, &IndexInfo);
1297 GetItemText(Index, iSubItem, Item1.GetBuffer(MAX_STR_LEN), MAX_STR_LEN);
1298 Item1.ReleaseBuffer();
1299
1300 IndexInfo.lParam = lParam2;
1301 Index = FindItem(-1, &IndexInfo);
1302 GetItemText(Index, iSubItem, Item2.GetBuffer(MAX_STR_LEN), MAX_STR_LEN);
1303 Item2.ReleaseBuffer();
1304
1305 return bIsAscending ? Item1.Compare(Item2) : Item2.Compare(Item1);
1306}
1307
1308HWND
1310{
1311 RECT r = {205, 28, 465, 250};
1314
1316
1317 if (hwnd)
1318 {
1319 ShowCheckboxes(false);
1320 }
1321
1322#pragma push_macro("SubclassWindow")
1323#undef SubclassWindow
1324 m_hWnd = NULL;
1326#pragma pop_macro("SubclassWindow")
1327
1328 return hwnd;
1329}
1330
1331BOOL
1333{
1334 return (BOOL)(GetItemState(item, LVIS_STATEIMAGEMASK) >> 12) - 1;
1335}
1336
1337VOID
1339{
1340 if (bHasCheckboxes)
1341 {
1342 SetItemState(item, INDEXTOSTATEIMAGEMASK((fCheck) ? 2 : 1), LVIS_STATEIMAGEMASK);
1343 }
1344}
1345
1346VOID
1348{
1349 if (bHasCheckboxes)
1350 {
1352 {
1353 // clear all
1354 SetCheckState(-1, FALSE);
1355 }
1356 else
1357 {
1358 // check all
1359 SetCheckState(-1, TRUE);
1360 }
1361 }
1362}
1363
1364PVOID
1366{
1367 INT item = GetSelectionMark();
1368 if (item == -1)
1369 {
1370 return (PVOID)0;
1371 }
1372 return (PVOID)GetItemData(item);
1373}
1374
1375BOOL
1377{
1378 ++g_AsyncIconTaskId; // Stop loading icons that are now invalid
1379 if (!DeleteAllItems())
1380 return FALSE;
1381
1382 ApplicationViewType = AppType;
1384 ItemCount = 0;
1385 CheckedItemCount = 0;
1386
1387 ListView_Scroll(m_hWnd, 0, 0x7fff * -1); // FIXME: a bug in Wine ComCtl32 where VScroll is not reset after deleting items
1388
1389 // delete old columns
1390 while (ColumnCount)
1391 {
1393 }
1394
1396 {
1406 }
1408
1410 if (g_DefaultPackageIconILIdx == -1)
1412
1413 // add new columns
1414 CStringW szText;
1415 switch (AppType)
1416 {
1418
1419 /* Add columns to ListView */
1420 szText.LoadStringW(IDS_APP_NAME);
1421 AddColumn(ColumnCount++, szText, 368, LVCFMT_LEFT);
1422
1423 szText.LoadStringW(IDS_APP_INST_VERSION);
1424 AddColumn(ColumnCount++, szText, 90, LVCFMT_RIGHT);
1425
1426#if 0 // This column is not currently useful for installed apps.
1427 szText.LoadStringW(IDS_APP_DESCRIPTION);
1428 AddColumn(ColumnCount++, szText, 300, LVCFMT_LEFT);
1429#endif
1430
1431 // Disable checkboxes
1432 ShowCheckboxes(false);
1433 break;
1434
1436
1437 /* Add columns to ListView */
1438 szText.LoadStringW(IDS_APP_NAME);
1439 AddColumn(ColumnCount++, szText, 250, LVCFMT_LEFT);
1440
1441 szText.LoadStringW(IDS_APP_INST_VERSION);
1442 AddColumn(ColumnCount++, szText, 90, LVCFMT_RIGHT);
1443
1444 szText.LoadStringW(IDS_APP_DESCRIPTION);
1445 AddColumn(ColumnCount++, szText, 300, LVCFMT_LEFT);
1446
1447 // Enable checkboxes
1448 ShowCheckboxes(true);
1449 break;
1450
1451 default:
1452 break;
1453 }
1454
1455 return TRUE;
1456}
1457
1458BOOL
1460{
1461 return SendMessage(LVM_SETVIEW, (WPARAM)ViewMode, 0) == 1;
1462}
1463
1464BOOL
1465CAppsListView::AddApplication(CAppInfo *AppInfo, BOOL InitialCheckState)
1466{
1467 if (!AppInfo)
1468 {
1470 return TRUE;
1471 }
1472
1475 {
1476 int Index = AddItem(ItemCount, IconIndex, AppInfo->szDisplayName, (LPARAM)AppInfo);
1477 if (Index == -1)
1478 return FALSE;
1479 CAsyncLoadIcon::Queue(m_hWnd, *AppInfo, true);
1480
1481 SetItemText(Index, 1, AppInfo->szDisplayVersion.IsEmpty() ? L"---" : AppInfo->szDisplayVersion);
1482 SetItemText(Index, 2, AppInfo->szComments.IsEmpty() ? L"---" : AppInfo->szComments);
1483
1484 ItemCount++;
1485 return TRUE;
1486 }
1488 {
1489 int Index = AddItem(ItemCount, IconIndex, AppInfo->szDisplayName, (LPARAM)AppInfo);
1490 if (Index == -1)
1491 return FALSE;
1492 CAsyncLoadIcon::Queue(m_hWnd, *AppInfo, false);
1493
1494 if (InitialCheckState)
1495 {
1497 }
1498
1499 SetItemText(Index, 1, AppInfo->szDisplayVersion);
1500 SetItemText(Index, 2, AppInfo->szComments);
1501
1502 ItemCount++;
1503 return TRUE;
1504 }
1505 else
1506 {
1507 return FALSE;
1508 }
1509}
1510
1511// this function is called when parent window receiving an notification about checkstate changing
1512VOID
1514{
1515 if (bCheck)
1516 {
1518 }
1519 else
1520 {
1522 }
1523}
1524// **** CAppsListView ****
1525
1526// **** CApplicationView ****
1527
1528BOOL
1530 HWND hwnd,
1531 UINT message,
1532 WPARAM wParam,
1533 LPARAM lParam,
1534 LRESULT &theResult,
1535 DWORD dwMapId)
1536{
1537 theResult = 0;
1538 switch (message)
1539 {
1540 case WM_CREATE:
1541 {
1542 BOOL bSuccess = TRUE;
1543 m_Panel = new CUiPanel();
1546
1547 bSuccess &= CreateToolbar();
1548 bSuccess &= CreateSearchBar();
1549 bSuccess &= CreateComboBox();
1550 bSuccess &= CreateHSplitter();
1551 bSuccess &= CreateListView();
1552 bSuccess &= CreateAppInfoDisplay();
1553
1554 /* APPWIZ-mode: Remove the unneeded menu items and toolbar buttons */
1556 {
1557 HMENU hMenu;
1558
1559 /* Delete the "Settings" item in the "File" sub-menu */
1560 hMenu = ::GetSubMenu(m_MainWindow->GetMenu(), 0);
1562
1563 /* Remove the menu items: ID_INSTALL, ID_RESETDB */
1564 hMenu = GetMenu();
1567
1568 /* Remove the toolbar buttons:
1569 * ID_INSTALL, ID_CHECK_ALL, ID_RESETDB
1570 * We only keep:
1571 * ID_UNINSTALL, ID_MODIFY, ID_REFRESH */
1572 TBBUTTONINFO info = { sizeof(info), 0 };
1573 int index;
1574
1576 if (index >= 0) m_Toolbar->DeleteButton(index);
1577
1579 if (index >= 0) m_Toolbar->DeleteButton(index);
1580
1582 if (index >= 0) m_Toolbar->DeleteButton(index);
1583
1584 /* Update the ideal width to use as a max width of buttons */
1586 }
1587
1588 /* Resize the toolbar */
1590
1591 RECT rTop;
1592
1593 ::GetWindowRect(m_Toolbar->m_hWnd, &rTop);
1594 m_HSplitter->m_Margin.top = rTop.bottom - rTop.top;
1595 if (!bSuccess)
1596 {
1597 return -1; // creation failure
1598 }
1599 }
1600 break;
1601
1602 case WM_NOTIFY:
1603 {
1604 LPNMHDR pNotifyHeader = (LPNMHDR)lParam;
1605 if (pNotifyHeader->hwndFrom == m_ListView->GetWindow())
1606 {
1607 switch (pNotifyHeader->code)
1608 {
1609 case LVN_ITEMCHANGED:
1610 {
1612
1613 /* Check if this is a valid item
1614 * (technically, it can be also an unselect) */
1615 INT ItemIndex = pnic->iItem;
1616 if (ItemIndex == -1 || ItemIndex >= ListView_GetItemCount(pnic->hdr.hwndFrom))
1617 {
1618 break;
1619 }
1620
1621 /* Check if the focus has been moved to another item */
1622 if ((pnic->uChanged & LVIF_STATE) && (pnic->uNewState & LVIS_FOCUSED) &&
1623 !(pnic->uOldState & LVIS_FOCUSED))
1624 {
1625 ItemGetFocus((LPVOID)pnic->lParam);
1626 }
1627
1628 /* Check if the item is checked/unchecked */
1629 if (pnic->uChanged & LVIF_STATE)
1630 {
1631 int iOldState = STATEIMAGETOINDEX(pnic->uOldState);
1632 int iNewState = STATEIMAGETOINDEX(pnic->uNewState);
1633
1634 if (iOldState == STATEIMAGE_UNCHECKED && iNewState == STATEIMAGE_CHECKED)
1635 {
1636 // this item is just checked
1639 }
1640 else if (iOldState == STATEIMAGE_CHECKED && iNewState == STATEIMAGE_UNCHECKED)
1641 {
1642 // this item is just unchecked
1645 }
1646 }
1647
1648 /* Ensure that if there are any items still focused/selected,
1649 * the ID_INSTALL menu item and toolbar button stay enabled */
1650 if ((pnic->uChanged & LVIF_STATE) && !m_MainWindow->bUpdating)
1652 }
1653 break;
1654
1655 case LVN_COLUMNCLICK:
1656 {
1658
1659 m_ListView->ColumnClick(pnmv);
1660 }
1661 break;
1662
1663 case NM_DBLCLK:
1664 {
1666 if (Item->iItem != -1)
1667 {
1668 /* this won't do anything if the program is already installed */
1669
1671 {
1673 (CAppInfo *)m_ListView->GetItemData(Item->iItem));
1674 }
1675 }
1676 }
1677 break;
1678 }
1679 }
1680 else if (pNotifyHeader->hwndFrom == m_Toolbar->GetWindow())
1681 {
1682 switch (pNotifyHeader->code)
1683 {
1684 case TTN_GETDISPINFO:
1686 break;
1687 }
1688 }
1689 }
1690 break;
1691
1692 case WM_SYSCOLORCHANGE:
1693 {
1694 /* Forward WM_SYSCOLORCHANGE to common controls */
1695 m_ListView->SendMessageW(WM_SYSCOLORCHANGE, wParam, lParam);
1696 m_AppsInfo->SendMessageW(WM_SYSCOLORCHANGE, wParam, lParam);
1697 m_Toolbar->SendMessageW(WM_SYSCOLORCHANGE, wParam, lParam);
1698 m_ComboBox->SendMessageW(WM_SYSCOLORCHANGE, wParam, lParam);
1699 }
1700 break;
1701
1702 case WM_SIZE:
1703 {
1705 break;
1706 }
1707
1708 case WM_COMMAND:
1709 {
1711 }
1712 break;
1713
1714 case WM_CONTEXTMENU:
1715 {
1716 bool kbd = -1 == (int)(INT_PTR)lParam;
1717 if ((HWND)wParam == m_ListView->m_hWnd)
1718 {
1719 int item = m_ListView->GetNextItem(-1, LVNI_FOCUSED | LVNI_SELECTED);
1720 if (item != -1)
1721 {
1722 POINT *ppt = NULL, pt;
1723 if (kbd)
1724 {
1725 RECT r;
1727 pt.x = r.left + (r.right - r.left) / 2;
1728 pt.y = r.top + (r.bottom - r.top) / 2;
1729 ::ClientToScreen((HWND)wParam, ppt = &pt);
1730 }
1731 ShowPopupMenuEx(m_hWnd, m_hWnd, 0, ID_INSTALL, ppt);
1732 return TRUE;
1733 }
1734 }
1735 }
1736 break;
1737 }
1738 return FALSE;
1739}
1740
1741BOOL
1743{
1744 m_Toolbar = new CMainToolbar();
1748
1749 return m_Toolbar->Create(m_hWnd) != NULL;
1750}
1751
1752BOOL
1754{
1760
1761 return m_SearchBar->Create(m_Toolbar->m_hWnd) != NULL;
1762}
1763
1764BOOL
1766{
1770 m_ComboBox->m_Margin.top = 4;
1771
1772 return m_ComboBox->Create(m_Toolbar->m_hWnd) != NULL;
1773}
1774
1775BOOL
1777{
1778 m_HSplitter = new CUiSplitPanel();
1783 m_HSplitter->m_Pos = INT_MAX; // set INT_MAX to use lowest possible position (m_MinSecond)
1784 m_HSplitter->m_MinFirst = 10;
1785 m_HSplitter->m_MinSecond = 140;
1787
1788 return m_HSplitter->Create(m_hWnd) != NULL;
1789}
1790
1791BOOL
1793{
1794 m_ListView = new CAppsListView();
1798
1799 return m_ListView->Create(m_hWnd) != NULL;
1800}
1801
1802BOOL
1804{
1809
1810 return m_AppsInfo->Create(m_hWnd) != NULL;
1811}
1812
1813void
1815{
1816 CWindow::SetRedraw(bRedraw);
1817 m_ListView->SetRedraw(bRedraw);
1818}
1819
1820void
1822{
1823 if (ApplicationViewType != AppViewTypeAvailableApps || !PackageName)
1824 return;
1825 CAppInfo *pApp;
1826 for (UINT i = 0; (pApp = (CAppInfo*)m_ListView->GetItemData(i)) != NULL; ++i)
1827 {
1828 if (pApp->szIdentifier.CompareNoCase(PackageName) == 0)
1829 {
1830 RefreshDetailsPane(*pApp, true);
1831 break;
1832 }
1833 }
1834}
1835
1836void
1838{
1840}
1841
1842VOID
1844{
1845 if (wParam == SIZE_MINIMIZED)
1846 return;
1847
1848 /* Resize the toolbar */
1850
1851 /* Automatically hide captions */
1852 DWORD dToolbarTreshold = m_Toolbar->GetMaxButtonsWidth();
1853 DWORD dSearchbarMargin = (LOWORD(lParam) - m_SearchBar->m_Width - m_ComboBox->m_Width - TOOLBAR_PADDING * 2);
1854
1855 if (dSearchbarMargin > dToolbarTreshold)
1856 {
1858 }
1859 else if (dSearchbarMargin < dToolbarTreshold)
1860 {
1862 }
1863
1864 RECT r = {0, 0, LOWORD(lParam), HIWORD(lParam)};
1865 HDWP hdwp = NULL;
1867
1868 hdwp = BeginDeferWindowPos(count);
1869 if (hdwp)
1870 {
1871 hdwp = m_Panel->OnParentSize(r, hdwp);
1872 if (hdwp)
1873 {
1874 EndDeferWindowPos(hdwp);
1875 }
1876 }
1877
1879 hdwp = BeginDeferWindowPos(count);
1880 if (hdwp)
1881 {
1882 hdwp = m_SearchBar->OnParentSize(r, hdwp);
1883 if (hdwp)
1884 {
1885 EndDeferWindowPos(hdwp);
1886 }
1887 }
1888
1891 hdwp = BeginDeferWindowPos(count);
1892 if (hdwp)
1893 {
1894 hdwp = m_ComboBox->OnParentSize(r, hdwp);
1895 if (hdwp)
1896 {
1897 EndDeferWindowPos(hdwp);
1898 }
1899 }
1900}
1901
1902VOID
1904{
1905 if (lParam)
1906 {
1907 if ((HWND)lParam == m_SearchBar->GetWindow())
1908 {
1909 CStringW szBuf;
1910 switch (HIWORD(wParam))
1911 {
1912 case EN_SETFOCUS:
1913 {
1914 CStringW szWndText;
1915
1916 szBuf.LoadStringW(IDS_SEARCH_TEXT);
1917 m_SearchBar->GetWindowTextW(szWndText);
1918 if (szBuf == szWndText)
1919 {
1920 m_SearchBar->SetWindowTextW(L"");
1921 }
1922 }
1923 break;
1924
1925 case EN_KILLFOCUS:
1926 {
1928 if (szBuf.IsEmpty())
1929 {
1930 szBuf.LoadStringW(IDS_SEARCH_TEXT);
1931 m_SearchBar->SetWindowTextW(szBuf.GetString());
1932 }
1933 }
1934 break;
1935
1936 case EN_CHANGE:
1937 {
1938 CStringW szWndText;
1939
1940 szBuf.LoadStringW(IDS_SEARCH_TEXT);
1941 m_SearchBar->GetWindowTextW(szWndText);
1942 if (szBuf == szWndText)
1943 {
1944 szWndText = L"";
1945 m_MainWindow->SearchTextChanged(szWndText);
1946 }
1947 else
1948 {
1949 m_MainWindow->SearchTextChanged(szWndText);
1950 }
1951 }
1952 break;
1953 }
1954
1955 return;
1956 }
1957 else if ((HWND)lParam == m_ComboBox->GetWindow())
1958 {
1959 int NotifyCode = HIWORD(wParam);
1960 switch (NotifyCode)
1961 {
1962 case CBN_SELCHANGE:
1963 int CurrSelection = m_ComboBox->SendMessageW(CB_GETCURSEL);
1964
1965 int ViewModeList[] = {LV_VIEW_DETAILS, LV_VIEW_LIST, LV_VIEW_TILE};
1966 ATLASSERT(CurrSelection < (int)_countof(ViewModeList));
1967 if (!m_ListView->SetViewMode(ViewModeList[CurrSelection]))
1968 {
1969 MessageBoxW(L"View mode invalid or unimplemented");
1970 }
1971 break;
1972 }
1973
1974 return;
1975 }
1976 else if ((HWND)lParam == m_Toolbar->GetWindow())
1977 {
1978 // the message is sent from Toolbar. fall down to continue process
1979 }
1980 else
1981 {
1982 return;
1983 }
1984 }
1985
1986 // the LOWORD of wParam contains a Menu or Control ID
1987 WORD wCommand = LOWORD(wParam);
1988
1989 switch (wCommand)
1990 {
1991 case ID_INSTALL:
1992 case ID_UNINSTALL:
1993 case ID_MODIFY:
1994 case ID_REGREMOVE:
1995 case ID_REFRESH:
1996 case ID_RESETDB:
1997 case ID_CHECK_ALL:
1998 m_MainWindow->SendMessageW(WM_COMMAND, wCommand, 0);
1999 break;
2000 }
2001}
2002
2003CApplicationView::CApplicationView(CMainWindow *MainWindow) : m_MainWindow(MainWindow)
2004{
2005}
2006
2008{
2009 delete m_Toolbar;
2010 delete m_SearchBar;
2011 delete m_ListView;
2012 delete m_AppsInfo;
2013 delete m_HSplitter;
2014}
2015
2018{
2019 DWORD csStyle = CS_VREDRAW | CS_HREDRAW;
2020 static ATL::CWndClassInfo wc = {
2021 {sizeof(WNDCLASSEX), csStyle, StartWindowProc, 0, 0, NULL, NULL, NULL, (HBRUSH)(COLOR_BTNFACE + 1), NULL,
2022 L"RAppsApplicationView", NULL},
2023 NULL,
2024 NULL,
2025 IDC_ARROW,
2026 TRUE,
2027 0,
2028 _T("")};
2029 return wc;
2030}
2031
2032HWND
2034{
2035 RECT r = {0, 0, 0, 0};
2036
2037 // Pick the "Programs" sub-menu for building the context menu.
2038 HMENU hMenu = ::GetSubMenu(m_MainWindow->GetMenu(), 1);
2039
2041}
2042
2043BOOL
2045{
2046 if (!m_ListView->SetDisplayAppType(AppType))
2047 return FALSE;
2048
2049 ApplicationViewType = AppType;
2051
2052 HMENU hMenu = GetMenu();
2053 switch (AppType)
2054 {
2056 {
2058 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_INSTALL, FALSE);
2059
2061 break;
2062 }
2063
2065 {
2066 // We shouldn't get there in APPWIZ-mode.
2068
2069 /* Even if no ListView item is focused at this point, enable
2070 * or disable ID_INSTALL if there are selected applications. */
2072
2073 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_CHECK_ALL, TRUE);
2074 break;
2075 }
2076 }
2077
2078 /* Always disable these items by default */
2083 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_MODIFY, FALSE);
2084
2085 return TRUE;
2086}
2087
2088BOOL
2090{
2091 return m_ListView->AddApplication(AppInfo, InitialCheckState);
2092}
2093
2094VOID
2096{
2098}
2099
2100void
2102{
2104}
2105
2106PVOID
2108{
2110}
2111
2112int
2114{
2115 return m_ListView->GetItemCount();
2116}
2117
2118VOID
2120{
2126}
2127
2128VOID
2130{
2131 LVITEMW &Item = Restore.Item;
2133 Item.iItem = -1, Item.iSubItem = 0;
2134 Item.stateMask = LVIS_FOCUSED|LVIS_SELECTED;
2135 Item.pszText = Restore.Name, Item.cchTextMax = _countof(Restore.Name);
2136
2137 HWND hList = m_ListView ? m_ListView->m_hWnd : NULL;
2138 if (hList)
2139 {
2142 }
2143}
2144
2145VOID
2147{
2148 const LVITEMW &Item = Restore.Item;
2149 int index = Item.iItem;
2150 if (index != -1) // Was there a selected item?
2151 {
2152 LVFINDINFOW fi;
2153 fi.flags = LVFI_STRING;
2154 fi.psz = Item.pszText;
2155 index = ListView_FindItem(m_ListView->m_hWnd, -1, &fi);
2156 }
2157 if (index != -1) // Is it still in the list?
2158 {
2159 ListView_SetItemState(m_ListView->m_hWnd, index, Item.state, Item.stateMask);
2160 }
2161}
2162
2163VOID
2165{
2166 m_AppsInfo->ShowAppInfo(Info, OnlyUpdateText);
2167}
2168
2169void
2171{
2173 {
2175 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_INSTALL, FALSE);
2176 }
2178 {
2179 // We shouldn't get there in APPWIZ-mode.
2181
2182 /* Even if no ListView item is focused at this point, enable
2183 * or disable ID_INSTALL if there are selected applications. */
2184 BOOL CanInstall = !m_MainWindow->m_Selected.IsEmpty();
2185 CanInstall = CanInstall || (m_ListView->GetSelectedCount() > 0);
2187 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_INSTALL, CanInstall);
2188 }
2189}
2190
2191// This function is called when a ListView item gets the focus.
2192// CallbackParam is the param passed to the ListView when adding the item (the one getting focus now).
2193VOID
2195{
2196 if (!CallbackParam)
2197 return;
2198
2199 CAppInfo *Info = static_cast<CAppInfo *>(CallbackParam);
2201
2202 HMENU hMenu = GetMenu();
2204 {
2205 /* ID_INSTALL is left disabled */
2206
2208 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_UNINSTALL, TRUE);
2209
2210 BOOL CanModify = Info->CanModify();
2211 EnableMenuItem(hMenu, ID_MODIFY, CanModify ? MF_ENABLED : MF_GRAYED);
2212 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_MODIFY, CanModify);
2213
2215 }
2217 {
2218 // We shouldn't get there in APPWIZ-mode.
2220
2222 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_INSTALL, TRUE);
2223
2224 /* ID_UNINSTALL, ID_MODIFY and ID_REGREMOVE are left disabled */
2225 // TODO: When we are able to detect whether this selected available
2226 // application is already installed (could be an older version),
2227 // do also what's done in the AppViewTypeInstalledApps case above.
2228 }
2229}
2230
2231// This function is called when a ListView item (an application) is checked/unchecked.
2232// CallbackParam is the param passed to the ListView when adding the item (the one getting changed now).
2233VOID
2235{
2236 m_MainWindow->ItemCheckStateChanged(bChecked, CallbackParam);
2237}
2238// **** CApplicationView ****
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL sqrt(const complex< float > &)
Definition: complex.cpp:188
Arabic default style
Definition: afstyles.h:94
static int g_DefaultPackageIconILIdx
Definition: appview.cpp:17
int ScrnshotDownloadCallback(pASYNCINET AsyncInet, ASYNC_EVENT Event, WPARAM wParam, LPARAM lParam, VOID *Extension)
Definition: appview.cpp:320
BOOL DeleteMenuEx(_In_ HMENU hMenu, _In_ UINT uPosition, _In_ UINT uFlags)
Definition: appview.cpp:23
static UINT g_AsyncIconTaskId
Definition: appview.cpp:1057
static DWORD CALLBACK AsyncLoadIconProc(LPVOID Param)
Definition: appview.cpp:1060
struct CAsyncLoadIcon * g_AsyncIconTasks
UINT g_IconSize
Definition: appview.cpp:18
HICON g_hDefaultPackageIcon
Definition: appview.cpp:16
#define WM_RAPPS_DOWNLOAD_COMPLETE
Definition: appview.h:39
#define WM_RAPPSLIST_ASYNCICON
Definition: appview.h:42
int ScrnshotDownloadCallback(pASYNCINET AsyncInet, ASYNC_EVENT Event, WPARAM wParam, LPARAM lParam, VOID *Extension)
Definition: appview.cpp:320
#define BROKENIMG_ICON_SIZE
Definition: appview.h:24
#define STATEIMAGETOINDEX(x)
Definition: appview.h:60
#define WM_RAPPS_RESIZE_CHILDREN
Definition: appview.h:41
#define STATEIMAGE_UNCHECKED
Definition: appview.h:64
#define TOOLBAR_PADDING
Definition: appview.h:36
#define PI
Definition: appview.h:57
#define SCRNSHOT_MAX_ASPECT_RAT
Definition: appview.h:27
#define LOADING_ANIMATION_PERIOD
Definition: appview.h:54
#define STATEIMAGE_CHECKED
Definition: appview.h:65
#define LOADING_ANIMATION_FPS
Definition: appview.h:55
#define RICHEDIT_MIN_WIDTH
Definition: appview.h:33
SCRNSHOT_STATUS
Definition: appview.h:45
@ SCRNSHOT_PREV_LOADING
Definition: appview.h:47
@ SCRNSHOT_PREV_FAILED
Definition: appview.h:49
@ SCRNSHOT_PREV_EMPTY
Definition: appview.h:46
@ SCRNSHOT_PREV_IMAGE
Definition: appview.h:48
struct __ScrnshotDownloadParam ScrnshotDownloadParam
HICON g_hDefaultPackageIcon
Definition: appview.cpp:16
#define TIMER_LOADING_ANIMATION
Definition: appview.h:52
#define INFO_DISPLAY_PADDING
Definition: appview.h:30
APPLICATION_VIEW_TYPE
Definition: appview.h:70
@ AppViewTypeInstalledApps
Definition: appview.h:72
@ AppViewTypeAvailableApps
Definition: appview.h:71
pASYNCINET AsyncInetDownload(LPCWSTR lpszAgent, DWORD dwAccessType, LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, LPCWSTR lpszUrl, BOOL bAllowCache, ASYNCINET_CALLBACK Callback, VOID *Extension)
Definition: asyncinet.cpp:33
BOOL AsyncInetCancel(pASYNCINET AsyncInet)
Definition: asyncinet.cpp:126
VOID AsyncInetRelease(pASYNCINET AsyncInet)
Definition: asyncinet.cpp:184
ASYNC_EVENT
Definition: asyncinet.h:6
@ ASYNCINET_ERROR
Definition: asyncinet.h:15
@ ASYNCINET_COMPLETE
Definition: asyncinet.h:9
@ ASYNCINET_CANCELLED
Definition: asyncinet.h:12
@ ASYNCINET_DATA
Definition: asyncinet.h:7
#define IDI_MAIN
Definition: resource.h:4
#define ID_EXIT
Definition: resource.h:10
HTREEITEM InsertItem(HWND hTree, LPCWSTR szName, HTREEITEM hParent, HTREEITEM hInsertAfter)
Definition: treeview.c:95
#define IDS_TOOLTIP_REFRESH
Definition: resource.h:48
#define ID_REFRESH
Definition: resource.h:16
#define index(s, c)
Definition: various.h:29
#define MAX_STR_LEN
Definition: defines.h:43
BOOL GetStorageDirectory(CStringW &lpDirectory)
Definition: misc.cpp:237
VOID ShowPopupMenuEx(HWND hwnd, HWND hwndOwner, UINT MenuID, UINT DefaultItem, POINT *Point=NULL)
Definition: misc.cpp:80
INT GetSystemColorDepth()
Definition: misc.cpp:395
VOID CopyTextToClipboard(LPCWSTR lpszText)
Definition: misc.cpp:28
#define ID_REGREMOVE
Definition: resource.h:83
#define IDS_TOOLTIP_UPDATE_DB
Definition: resource.h:144
#define IDS_APP_DESCRIPTION
Definition: resource.h:149
#define IDS_TOOLTIP_INSTALL
Definition: resource.h:137
#define IDS_SEARCH_TEXT
Definition: resource.h:102
#define ID_UNINSTALL
Definition: resource.h:75
#define IDI_UPDATE_DB
Definition: resource.h:15
#define IDS_WELCOME_TITLE
Definition: resource.h:94
#define ID_COPY_LINK
Definition: resource.h:80
#define IDS_WELCOME_TEXT
Definition: resource.h:95
#define IDS_APPWIZ_TEXT1
Definition: resource.h:98
#define IDS_TOOLTIP_SETTINGS
Definition: resource.h:141
#define IDI_EXIT
Definition: resource.h:6
#define IDI_BROKEN_IMAGE
Definition: resource.h:18
#define IDI_MODIFY
Definition: resource.h:10
#define IDS_APP_INST_VERSION
Definition: resource.h:148
#define IDR_LINKMENU
Definition: resource.h:70
#define ID_CHECK_ALL
Definition: resource.h:85
#define IDI_CHECK_ALL
Definition: resource.h:16
#define IDS_TOOLTIP_MODIFY
Definition: resource.h:139
#define IDI_INSTALL
Definition: resource.h:7
#define IDI_SETTINGS
Definition: resource.h:9
#define ID_MODIFY
Definition: resource.h:78
#define ID_OPEN_LINK
Definition: resource.h:79
#define IDI_UNINSTALL
Definition: resource.h:8
#define IDS_TOOLTIP_UNINSTALL
Definition: resource.h:138
#define IDS_TOOLTIP_SELECT_ALL
Definition: resource.h:140
#define ID_RESETDB
Definition: resource.h:84
#define IDS_APPWIZ_TEXT2
Definition: resource.h:99
#define IDS_APP_NAME
Definition: resource.h:147
#define IDS_TOOLTIP_EXIT
Definition: resource.h:143
#define IDS_APPWIZ_TITLE
Definition: resource.h:97
#define ID_INSTALL
Definition: resource.h:74
#define IDS_WELCOME_URL
Definition: resource.h:96
#define ID_SETTINGS
Definition: resource.h:81
#define IDI_REFRESH
Definition: resource.h:11
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:21
#define InterlockedIncrement64(a)
Definition: btrfs_drv.h:143
bool IsEmpty() const
Definition: atlcoll.h:548
bool IsEmpty() const noexcept
Definition: atlsimpstr.h:394
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:387
PXSTR GetString() noexcept
Definition: atlsimpstr.h:367
int GetLength() const noexcept
Definition: atlsimpstr.h:362
void Empty() noexcept
Definition: atlsimpstr.h:253
int CompareNoCase(_In_z_ PCXSTR psz) const
Definition: cstringt.h:743
int Compare(_In_z_ PCXSTR psz) const
Definition: cstringt.h:738
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
HDC GetDC()
Definition: atlwin.h:547
HWND SetFocus()
Definition: atlwin.h:1198
void SetRedraw(BOOL bRedraw=TRUE)
Definition: atlwin.h:1234
HMENU GetMenu() const
Definition: atlwin.h:682
CWindow GetParent() const
Definition: atlwin.h:700
BOOL IsWindowVisible() const
Definition: atlwin.h:958
HWND m_hWnd
Definition: atlwin.h:273
static Bitmap * FromFile(const WCHAR *filename, BOOL useEmbeddedColorManagement)
VOID OnCommand(WPARAM wParam, LPARAM lParam)
Definition: appview.cpp:1015
HWND Create(HWND hwndParent)
Definition: appview.cpp:951
BOOL ProcessWindowMessage(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId)
Definition: appview.cpp:776
VOID OnLink(ENLINK *Link)
Definition: appview.cpp:895
VOID ResizeChildren()
Definition: appview.cpp:838
CAppRichEdit * RichEdit
Definition: appview.h:168
VOID ShowAppInfo(CAppInfo &Info, bool OnlyUpdateText=false)
Definition: appview.cpp:959
void SetWelcomeText(bool bAppwiz)
Definition: appview.cpp:978
CAppScrnshotPreview * ScrnshotPrev
Definition: appview.h:169
LPWSTR pLink
Definition: appview.h:154
static ATL::CWndClassInfo & GetWndClassInfo()
Definition: appview.cpp:925
virtual BOOL RetrieveIcon(CStringW &Path) const =0
CStringW szDisplayName
Definition: appinfo.h:112
const CStringW szIdentifier
Definition: appinfo.h:108
VOID InsertTextWithString(UINT StringID, const CStringW &Text, DWORD TextFlags)
Definition: appview.cpp:310
VOID LoadAndInsertText(UINT uStringID, const CStringW &szText, DWORD TextFlags)
Definition: appview.cpp:286
float GetLoadingDotWidth(int width, int height)
Definition: appview.cpp:606
CAppScrnshotPreview(const CStringW &BasePath)
Definition: appview.cpp:352
VOID PreviousDisplayCleanup()
Definition: appview.cpp:644
VOID SetStatus(SCRNSHOT_STATUS Status)
Definition: appview.cpp:516
SCRNSHOT_STATUS ScrnshotPrevStauts
Definition: appview.h:101
BOOL DisplayFile(LPCWSTR lpszFileName)
Definition: appview.cpp:502
VOID PaintOnDC(HDC hdc, int width, int height, BOOL bDrawBkgnd)
Definition: appview.cpp:522
BOOL ProcessWindowMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId)
Definition: appview.cpp:357
HICON hBrokenImgIcon
Definition: appview.h:103
LONGLONG ContentID
Definition: appview.h:108
int LoadingAnimationFrame
Definition: appview.h:105
CStringW TempImagePath
Definition: appview.h:110
HWND Create(HWND hParent)
Definition: appview.cpp:636
float GetFrameDotShift(int Frame, int width, int height)
Definition: appview.cpp:612
BOOL DisplayImage(LPCWSTR lpszLocation)
Definition: appview.cpp:677
pASYNCINET AsyncInet
Definition: appview.h:107
CStringW m_BasePath
Definition: appview.h:100
Gdiplus::Image * pImage
Definition: appview.h:102
static ATL::CWndClassInfo & GetWndClassInfo()
Definition: appview.cpp:620
int GetRequestedWidth(int Height)
Definition: appview.cpp:741
BOOL CreateToolbar()
Definition: appview.cpp:1742
PVOID GetFocusedItemData()
Definition: appview.cpp:2107
void _UpdateInstallBtn()
Definition: appview.cpp:2170
VOID ItemGetFocus(LPVOID CallbackParam)
Definition: appview.cpp:2194
BOOL CreateHSplitter()
Definition: appview.cpp:1776
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:356
HWND Create(HWND hwndParent)
Definition: appview.cpp:2033
BOOL CreateAppInfoDisplay()
Definition: appview.cpp:1803
VOID OnCommand(WPARAM wParam, LPARAM lParam)
Definition: appview.cpp:1903
static ATL::CWndClassInfo & GetWndClassInfo()
Definition: appview.cpp:2017
CUiPanel * m_Panel
Definition: appview.h:348
VOID GetRestoreListSelectionData(RESTORELISTSELECTION &Restore)
Definition: appview.cpp:2129
CUiWindow< CComboBox > * m_ComboBox
Definition: appview.h:350
VOID RestoreListSelection(const RESTORELISTSELECTION &Restore)
Definition: appview.cpp:2146
CUiWindow< CSearchBar > * m_SearchBar
Definition: appview.h:351
void RefreshAvailableItem(PCWSTR PackageName)
Definition: appview.cpp:1821
BOOL AddApplication(CAppInfo *InstAppInfo, BOOL InitialCheckState)
Definition: appview.cpp:2089
BOOL ProcessWindowMessage(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId)
Definition: appview.cpp:1529
BOOL SetDisplayAppType(APPLICATION_VIEW_TYPE AppType)
Definition: appview.cpp:2044
CApplicationView(CMainWindow *MainWindow)
Definition: appview.cpp:2003
CMainWindow * m_MainWindow
Definition: appview.h:355
CAppInfoDisplay * m_AppsInfo
Definition: appview.h:353
void SetFocusOnSearchBar()
Definition: appview.cpp:1837
VOID OnSize(HWND hwnd, WPARAM wParam, LPARAM lParam)
Definition: appview.cpp:1843
CUiSplitPanel * m_HSplitter
Definition: appview.h:354
void SetRedraw(BOOL bRedraw)
Definition: appview.cpp:1814
BOOL CreateComboBox()
Definition: appview.cpp:1765
VOID RefreshDetailsPane(CAppInfo &Info, bool OnlyUpdateText=false)
Definition: appview.cpp:2164
BOOL CreateSearchBar()
Definition: appview.cpp:1753
CMainToolbar * m_Toolbar
Definition: appview.h:349
VOID AppendTabOrderWindow(int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
Definition: appview.cpp:2119
VOID SetWatermark(const CStringW &Text)
Definition: appview.cpp:2095
BOOL CreateListView()
Definition: appview.cpp:1792
CAppsListView * m_ListView
Definition: appview.h:352
VOID ItemCheckStateChanged(BOOL bChecked, LPVOID CallbackParam)
Definition: appview.cpp:2234
INT AddItem(INT ItemIndex, INT IconIndex, LPCWSTR lpText, LPARAM lParam)
Definition: appview.cpp:1253
void DeleteColumn(INT Index)
Definition: appview.cpp:1246
VOID ColumnClick(LPNMLISTVIEW pnmv)
Definition: appview.cpp:1190
INT ItemCount
Definition: appview.h:198
BOOL SetViewMode(DWORD ViewMode)
Definition: appview.cpp:1459
INT ColumnCount
Definition: appview.h:200
void ShowCheckboxes(bool bShow)
Definition: appview.cpp:1183
VOID ItemCheckStateNotify(int iItem, BOOL bCheck)
Definition: appview.cpp:1513
VOID CheckAll()
Definition: appview.cpp:1347
HIMAGELIST m_hImageListView
Definition: appview.h:206
HIMAGELIST GetImageList(int iImageList)
Definition: appview.cpp:1274
BOOL SetDisplayAppType(APPLICATION_VIEW_TYPE AppType)
Definition: appview.cpp:1376
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:204
LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: appview.cpp:1133
bool bHasCheckboxes
Definition: appview.h:196
PVOID GetFocusedItemData()
Definition: appview.cpp:1365
HWND Create(HWND hwndParent)
Definition: appview.cpp:1309
BOOL GetCheckState(INT item)
Definition: appview.cpp:1332
VOID SetWatermark(const CStringW &Text)
Definition: appview.cpp:1177
VOID SetCheckState(INT item, BOOL fCheck)
Definition: appview.cpp:1338
LRESULT OnAsyncIcon(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: appview.cpp:1151
INT nLastHeaderID
Definition: appview.h:202
BOOL AddColumn(INT Index, CStringW &Text, INT Width, INT Format)
Definition: appview.cpp:1230
CStringW m_Watermark
Definition: appview.h:207
BOOL AddApplication(CAppInfo *AppInfo, BOOL InitialCheckState)
Definition: appview.cpp:1465
INT CheckedItemCount
Definition: appview.h:199
static INT CALLBACK s_CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
Definition: appview.cpp:1280
BOOL bIsAscending
Definition: appview.h:195
INT CompareFunc(LPARAM lParam1, LPARAM lParam2, INT iSubItem)
Definition: appview.cpp:1287
const int m_DefaultSelectType
Definition: appview.h:333
HWND Create(HWND hwndParent)
Definition: appview.cpp:262
const UINT m_TypeStringID[3]
Definition: appview.h:331
int m_Width
Definition: appview.h:336
int m_Height
Definition: appview.h:337
HWND Create(HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
Definition: rosctrls.h:8
DWORD m_dButtonsWidthMax
Definition: appview.h:278
void UpdateMaxButtonsWidth()
Definition: appview.cpp:214
DWORD GetMaxButtonsWidth() const
Definition: appview.cpp:222
VOID OnGetDispInfo(LPTOOLTIPTEXT lpttt)
Definition: appview.cpp:110
HWND Create(HWND hwndParent)
Definition: appview.cpp:147
const INT m_iToolbarHeight
Definition: appview.h:277
void ShowButtonCaption(bool bShow)
Definition: appview.cpp:204
VOID AddImageToImageList(HIMAGELIST hImageList, UINT ImageIndex)
Definition: appview.cpp:67
HIMAGELIST InitImageList()
Definition: appview.cpp:82
BOOL m_bAppwizMode
Definition: gui.h:61
BOOL SearchTextChanged(CStringW &SearchText)
Definition: gui.cpp:849
BOOL bUpdating
Definition: gui.h:60
BOOL InstallApplication(CAppInfo *Info)
Definition: gui.cpp:843
CAtlList< CAppInfo * > m_Selected
Definition: gui.h:58
VOID ItemCheckStateChanged(BOOL bChecked, LPVOID CallbackParam)
Definition: gui.cpp:815
INT Append(T *ptr)
Definition: rosui.h:87
HWND Create(HWND hwndParent)
Definition: crichedit.h:104
VOID InsertText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:77
VOID SetText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:91
HWND Create(HWND hwndParent)
Definition: appview.cpp:241
const INT m_Height
Definition: appview.h:309
const INT m_Width
Definition: appview.h:308
VOID SetText(LPCWSTR lpszText)
Definition: appview.cpp:235
DWORD AutoSize()
Definition: rosctrls.h:378
DWORD DeleteButton(int index)
Definition: rosctrls.h:347
DWORD AddButtons(int count, TBBUTTON *buttons)
Definition: rosctrls.h:332
DWORD SetButtonStructSize()
Definition: rosctrls.h:286
HIMAGELIST SetImageList(HIMAGELIST himl)
Definition: rosctrls.h:424
DWORD GetButtonInfo(int cmdId, TBBUTTONINFO *info)
Definition: rosctrls.h:352
DWORD GetIdealSize(BOOL useHeight, LPSIZE size)
Definition: rosctrls.h:388
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
VOID GetWindowTextW(CStringW &szText)
Definition: rosui.h:561
virtual VOID AppendTabOrderWindow(int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
Definition: rosui.h:546
HWND GetWindow()
Definition: rosui.h:492
virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
Definition: rosui.h:522
virtual DWORD_PTR CountSizableChildren()
Definition: rosui.h:516
Status FillEllipse(const Brush *brush, const Rect &rect)
Status SetSmoothingMode(SmoothingMode smoothingMode)
Status DrawImage(Image *image, const Point *destPoints, INT count)
WPARAM wParam
Definition: combotst.c:138
char * Text
Definition: combotst.c:136
LPARAM lParam
Definition: combotst.c:139
struct @1672 Msg[]
int WINAPI DrawShadowText(HDC hdc, LPCWSTR pszText, UINT cch, RECT *prc, DWORD dwFlags, COLORREF crText, COLORREF crShadow, int ixOffset, int iyOffset)
Definition: commctrl.c:1852
static HWND hwndParent
Definition: cryptui.c:300
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#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
static HBITMAP hBitmap
Definition: timezone.c:26
float REAL
Definition: types.h:41
UINT uFlags
Definition: api.c:59
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:941
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:814
#define CloseHandle
Definition: compat.h:739
#define GetProcessHeap()
Definition: compat.h:736
HANDLE HWND
Definition: compat.h:19
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define CALLBACK
Definition: compat.h:35
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
static const WCHAR IconIndex[]
Definition: install.c:52
INT WINAPI GetMenuPosFromID(HMENU hMenu, UINT wID)
Definition: ordinal.c:4514
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1729
int WINAPI PathParseIconLocationW(LPWSTR lpszPath)
Definition: path.c:1098
BOOL WINAPI PathIsURLW(LPCWSTR lpstrPath)
Definition: url.c:2432
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define pt(x, y)
Definition: drawing.c:79
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:57
switch(r->id)
Definition: btrfs.c:3046
HINSTANCE hInst
Definition: dxdiag.c:13
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
Definition: filename.c:84
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
_Inout_opt_ PUNICODE_STRING Extension
Definition: fltkernel.h:1092
pKey DeleteObject()
Status
Definition: gdiplustypes.h:25
@ Ok
Definition: gdiplustypes.h:26
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLint GLint GLsizei width
Definition: gl.h:1546
GLsizeiptr size
Definition: glext.h:5919
GLuint color
Definition: glext.h:6243
GLuint index
Definition: glext.h:6031
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
UINT WINAPI ExtractIconExW(LPCWSTR lpszFile, INT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons)
Definition: iconcache.cpp:855
_Check_return_ _CRTIMP double __cdecl floor(_In_ double x)
#define INT_MAX
Definition: intsafe.h:150
HWND hList
Definition: livecd.c:10
#define CREATE_ALWAYS
Definition: disk.h:72
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
static HICON
Definition: imagelist.c:80
static float(__cdecl *square_half_float)(float x
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
static ATOM item
Definition: dde.c:856
#define min(a, b)
Definition: monoChain.cc:55
static const TBBUTTON Buttons[]
Definition: mplay32.c:41
static VOID SetImageList(HWND hwnd)
Definition: mplay32.c:238
HICON hIcon
Definition: msconfig.c:44
unsigned int UINT
Definition: ndis.h:50
HANDLE hThread
Definition: wizard.c:28
#define _In_
Definition: no_sal2.h:158
#define DWORD
Definition: nt_native.h:44
#define GENERIC_WRITE
Definition: nt_native.h:90
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
#define L(x)
Definition: ntvdm.h:50
#define MAKEINTRESOURCE(i)
Definition: ntverrsrc.c:25
#define PathAppendW
Definition: pathcch.h:309
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define WS_OVERLAPPED
Definition: pedump.c:615
#define ES_AUTOHSCROLL
Definition: pedump.c:672
#define WS_VISIBLE
Definition: pedump.c:620
#define ES_LEFT
Definition: pedump.c:664
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define INT
Definition: polytest.cpp:20
#define Header_GetItem(hwndHD, i, phdi)
Definition: commctrl.h:751
#define LV_VIEW_DETAILS
Definition: commctrl.h:2846
#define LVSIL_SMALL
Definition: commctrl.h:2304
#define BTNS_BUTTON
Definition: commctrl.h:998
#define TB_SETEXTENDEDSTYLE
Definition: commctrl.h:1190
#define ListView_SetItemState(hwndLV, i, data, mask)
Definition: commctrl.h:2678
#define ListView_GetItemRect(hwnd, i, prc, code)
Definition: commctrl.h:2483
#define LVS_SINGLESEL
Definition: commctrl.h:2271
#define LVFINDINFO
Definition: commctrl.h:2468
#define BTNS_AUTOSIZE
Definition: commctrl.h:1004
#define LVFI_STRING
Definition: commctrl.h:2442
#define LVS_SHAREIMAGELISTS
Definition: commctrl.h:2275
#define LVN_COLUMNCLICK
Definition: commctrl.h:3144
#define NM_DBLCLK
Definition: commctrl.h:131
#define LVM_GETHEADER
Definition: commctrl.h:2655
#define SBT_NOBORDERS
Definition: commctrl.h:1976
#define ListView_Scroll(hwndLV, dx, dy)
Definition: commctrl.h:2527
#define LVIF_STATE
Definition: commctrl.h:2317
#define TBSTYLE_TOOLTIPS
Definition: commctrl.h:989
#define Header_SetItem(hwndHD, i, phdi)
Definition: commctrl.h:758
#define LVNI_SELECTED
Definition: commctrl.h:2429
#define TBBUTTONINFO
Definition: commctrl.h:1254
#define BTNS_SEP
Definition: commctrl.h:999
#define LVFI_PARAM
Definition: commctrl.h:2441
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2272
#define LVM_DELETECOLUMN
Definition: commctrl.h:2643
#define LVS_REPORT
Definition: commctrl.h:2267
#define TBSTYLE_LIST
Definition: commctrl.h:993
#define TBSTYLE_EX_MIXEDBUTTONS
Definition: commctrl.h:1012
#define LVCF_WIDTH
Definition: commctrl.h:2592
#define LVNI_FOCUSED
Definition: commctrl.h:2428
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2439
#define LV_VIEW_LIST
Definition: commctrl.h:2848
#define LVS_EX_CHECKBOXES
Definition: commctrl.h:2736
#define TTN_GETDISPINFO
Definition: commctrl.h:1883
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2739
#define LVS_SORTASCENDING
Definition: commctrl.h:2273
#define LV_VIEW_TILE
Definition: commctrl.h:2849
#define ImageList_RemoveAll(himl)
Definition: commctrl.h:556
#define LVM_INSERTCOLUMN
Definition: commctrl.h:2639
#define HDF_SORTUP
Definition: commctrl.h:724
#define TBSTYLE_EX_HIDECLIPPEDBUTTONS
Definition: commctrl.h:1013
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2312
struct tagNMITEMACTIVATE * LPNMITEMACTIVATE
#define TB_ENABLEBUTTON
Definition: commctrl.h:1042
#define LVIR_LABEL
Definition: commctrl.h:2479
#define LVM_GETIMAGELIST
Definition: commctrl.h:2300
#define LVIS_SELECTED
Definition: commctrl.h:2324
#define LVITEM
Definition: commctrl.h:2380
#define TB_GETEXTENDEDSTYLE
Definition: commctrl.h:1191
#define TOOLBARCLASSNAMEW
Definition: commctrl.h:943
#define LVIF_PARAM
Definition: commctrl.h:2316
#define HDI_FORMAT
Definition: commctrl.h:705
struct tagNMLISTVIEW * LPNMLISTVIEW
#define LVS_NOSORTHEADER
Definition: commctrl.h:2290
#define LVIF_TEXT
Definition: commctrl.h:2314
#define TBSTATE_ENABLED
Definition: commctrl.h:974
#define ListView_SetItem(hwnd, pitem)
Definition: commctrl.h:2406
#define TBSTYLE_FLAT
Definition: commctrl.h:992
#define LVM_SETVIEW
Definition: commctrl.h:2851
#define LVCF_FMT
Definition: commctrl.h:2591
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define LVCF_SUBITEM
Definition: commctrl.h:2594
#define LVCFMT_LEFT
Definition: commctrl.h:2603
#define ILC_MASK
Definition: commctrl.h:351
#define INDEXTOSTATEIMAGEMASK(i)
Definition: commctrl.h:2333
#define SB_SETTEXT
Definition: commctrl.h:1954
#define LVCFMT_RIGHT
Definition: commctrl.h:2604
#define LVIF_IMAGE
Definition: commctrl.h:2315
#define LVN_ITEMCHANGED
Definition: commctrl.h:3136
#define LVCF_TEXT
Definition: commctrl.h:2593
#define LVIS_STATEIMAGEMASK
Definition: commctrl.h:2331
#define LVIS_FOCUSED
Definition: commctrl.h:2323
#define ListView_GetItem(hwnd, pitem)
Definition: commctrl.h:2399
#define HDF_SORTDOWN
Definition: commctrl.h:725
#define ListView_FindItem(hwnd, iStart, plvfi)
Definition: commctrl.h:2475
#define I_IMAGENONE
Definition: commctrl.h:2391
#define LVS_AUTOARRANGE
Definition: commctrl.h:2277
#define WC_COMBOBOX
Definition: commctrl.h:4723
#define LVSIL_NORMAL
Definition: commctrl.h:2303
#define LPTOOLTIPTEXT
Definition: commctrl.h:1895
#define EM_GETSELTEXT
Definition: richedit.h:95
#define CFE_BOLD
Definition: richedit.h:406
#define EM_SETBKGNDCOLOR
Definition: richedit.h:100
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define WM_PRINTCLIENT
Definition: richedit.h:70
#define CFM_LINK
Definition: richedit.h:337
#define EN_LINK
Definition: richedit.h:202
#define WM_NOTIFY
Definition: richedit.h:61
#define DefWindowProc
Definition: ros2win.h:31
@ UiAlign_Stretch
Definition: rosui.h:249
@ UiAlign_LeftTop
Definition: rosui.h:246
@ UiAlign_RightBtm
Definition: rosui.h:248
#define ID
Definition: ruserpass.c:36
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2507
#define _countof(array)
Definition: sndvol32.h:70
& rect
Definition: startmenu.cpp:1413
CAsyncLoadIcon * pNext
Definition: appview.cpp:1046
CAppInfo * AppInfo
Definition: appview.cpp:1048
WCHAR Location[ANYSIZE_ARRAY]
Definition: appview.cpp:1051
static void StartTasks()
Definition: appview.cpp:1109
static CAsyncLoadIcon * Queue(HWND hAppsList, CAppInfo &AppInfo, bool Parse)
Definition: appview.cpp:1087
base for all directory entries
Definition: entries.h:138
BOOL bSmallIcons
Definition: settings.h:12
UINT mask
Definition: commctrl.h:684
int fmt
Definition: commctrl.h:689
CStringW DownloadFileName
Definition: appview.h:80
Definition: tftpd.h:60
LPWSTR pszText
Definition: commctrl.h:2572
LPCWSTR psz
Definition: commctrl.h:2462
LPARAM lParam
Definition: commctrl.h:2463
UINT mask
Definition: commctrl.h:2365
UINT code
Definition: winuser.h:3170
HWND hwndFrom
Definition: winuser.h:3168
UINT uNewState
Definition: commctrl.h:3041
LPARAM lParam
Definition: commctrl.h:3045
UINT uOldState
Definition: commctrl.h:3042
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
#define max(a, b)
Definition: svc.c:63
#define GetWindowLongPtr
Definition: treelist.c:73
int32_t INT_PTR
Definition: typedefs.h:64
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define ANYSIZE_ARRAY
Definition: typedefs.h:46
int64_t LONGLONG
Definition: typedefs.h:68
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58
#define HIWORD(l)
Definition: typedefs.h:247
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
#define AddItem
Definition: userenv.h:209
static int Link(const char **args)
Definition: vfdcmd.c:2414
#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
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
Definition: wdfdevice.h:2225
WDF_EXTERN_C_START typedef _In_ WDFDEVICE _In_ WDFCONTEXT _In_ WDF_DMA_DIRECTION Direction
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesWritten
Definition: wdfiotarget.h:960
HDC hdcMem
Definition: welcome.c:104
#define ZeroMemory
Definition: winbase.h:1743
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
#define CopyMemory
Definition: winbase.h:1741
_In_ ULONG NotifyCode
Definition: winddi.h:4265
_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
CONST void * LPCVOID
Definition: windef.h:191
#define SubclassWindow(hwnd, lpfn)
Definition: windowsx.h:542
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define SelectFont(hdc, hfont)
Definition: windowsx.h:516
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
#define GetStockFont(i)
Definition: windowsx.h:308
#define ERROR_CANCELLED
Definition: winerror.h:726
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define DI_COMPAT
Definition: wingdi.h:68
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
#define DI_NORMAL
Definition: wingdi.h:72
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define SRCCOPY
Definition: wingdi.h:333
#define PATCOPY
Definition: wingdi.h:335
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
BOOL WINAPI DeleteDC(_In_ HDC)
#define INTERNET_OPEN_TYPE_PRECONFIG
Definition: wininet.h:521
#define WM_PAINT
Definition: winuser.h:1631
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_ERASEBKGND
Definition: winuser.h:1636
#define CS_VREDRAW
Definition: winuser.h:666
DWORD WINAPI GetSysColor(_In_ int)
#define MF_BYCOMMAND
Definition: winuser.h:202
#define DT_NOPREFIX
Definition: winuser.h:537
#define EN_KILLFOCUS
Definition: winuser.h:2036
#define COLOR_GRAYTEXT
Definition: winuser.h:943
#define DT_CENTER
Definition: winuser.h:527
#define LR_LOADFROMFILE
Definition: winuser.h:1103
#define CBS_DROPDOWNLIST
Definition: winuser.h:284
#define IMAGE_ICON
Definition: winuser.h:212
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1619
#define EN_SETFOCUS
Definition: winuser.h:2038
#define WM_SIZE
Definition: winuser.h:1622
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define PRF_ERASEBKGND
Definition: winuser.h:2537
#define DT_SINGLELINE
Definition: winuser.h:540
#define WM_COMMAND
Definition: winuser.h:1751
#define CS_HREDRAW
Definition: winuser.h:661
#define MIIM_FTYPE
Definition: winuser.h:740
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:2541
#define IDC_ARROW
Definition: winuser.h:695
#define CB_SETCURSEL
Definition: winuser.h:1972
#define WM_RBUTTONUP
Definition: winuser.h:1791
#define SW_SHOWNOACTIVATE
Definition: winuser.h:785
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define SIZE_MINIMIZED
Definition: winuser.h:2517
#define MFT_SEPARATOR
Definition: winuser.h:755
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1637
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2443
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define CBN_SELCHANGE
Definition: winuser.h:1990
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define SM_CXSMICON
Definition: winuser.h:1023
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define MF_ENABLED
Definition: winuser.h:128
#define WM_SETFONT
Definition: winuser.h:1661
#define WM_TIMER
Definition: winuser.h:1753
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define MF_BYPOSITION
Definition: winuser.h:203
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
Definition: cursoricon.c:2366
#define CB_ADDSTRING
Definition: winuser.h:1947
BOOL WINAPI UpdateWindow(_In_ HWND)
struct tagNMHDR * LPNMHDR
#define SendMessage
Definition: winuser.h:5863
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5739
#define EM_SETSEL
Definition: winuser.h:2029
#define CBS_HASSTRINGS
Definition: winuser.h:285
#define LR_SHARED
Definition: winuser.h:1111
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4327
#define WM_LBUTTONUP
Definition: winuser.h:1788
#define DT_VCENTER
Definition: winuser.h:543
#define LoadImage
Definition: winuser.h:5835
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
#define PRF_CHECKVISIBLE
Definition: winuser.h:2534
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define WM_DESTROY
Definition: winuser.h:1620
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define CB_GETCURSEL
Definition: winuser.h:1954
#define GWL_STYLE
Definition: winuser.h:863
#define SM_CXICON
Definition: winuser.h:983
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
int WINAPI GetSystemMetrics(_In_ int)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HMENU WINAPI GetMenu(_In_ HWND)
#define COLOR_BTNFACE
Definition: winuser.h:939
HDWP WINAPI BeginDeferWindowPos(_In_ int)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2391
#define MF_GRAYED
Definition: winuser.h:129
#define EN_CHANGE
Definition: winuser.h:2033
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185