ReactOS 0.4.16-dev-319-g6cf4263
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
18
19// **** Menu helpers ****
20
21BOOL
23 _In_ HMENU hMenu,
24 _In_ UINT uPosition,
26{
27 INT pos;
28 MENUITEMINFOW mii = { sizeof(mii), MIIM_FTYPE, 0 };
29 bool bIsValidItem1, bIsValidItem2;
30 bool bIsSep1, bIsSep2;
31
33 pos = (INT)uPosition;
34 else
35 pos = ::GetMenuPosFromID(hMenu, uPosition);
36 if (pos < 0)
37 return FALSE;
38
39 bIsValidItem1 = ((pos > 0) && ::GetMenuItemInfoW(hMenu, pos - 1, TRUE, &mii));
40 bIsSep1 = bIsValidItem1 && !!(mii.fType & MFT_SEPARATOR);
41
42 bIsValidItem2 = ::GetMenuItemInfoW(hMenu, pos + 1, TRUE, &mii);
43 bIsSep2 = bIsValidItem2 && !!(mii.fType & MFT_SEPARATOR);
44
45 if (bIsSep1 && !bIsSep2 && !bIsValidItem2)
46 pos = pos - 1; // Delete separator only if pos+1 has no item
47 else if (!bIsSep1 && bIsSep2 && !bIsValidItem1)
48 pos = pos + 1; // Delete separator only if pos-1 has no item
49 else if (bIsSep1 && bIsSep2)
50 pos = pos + 1;
51 else
52 pos = -1;
53
54 // Delete one of the separators if necessary
55 if (pos != -1)
57
58 // Finally, delete the menu item itself.
59 return ::DeleteMenu(hMenu, uPosition, uFlags);
60}
61// **** Menu helpers ****
62
63// **** CMainToolbar ****
64
65VOID
67{
68 HICON hImage;
69
70 if (!(hImage =
72 {
73 return;
74 }
75
76 ImageList_AddIcon(hImageList, hImage);
77 DeleteObject(hImage);
78}
79
82{
83 HIMAGELIST hImageList;
84
85 /* Create the toolbar icon image list */
87 if (!hImageList)
88 {
89 return NULL;
90 }
91
99 AddImageToImageList(hImageList, IDI_EXIT);
100
101 return hImageList;
102}
103
104CMainToolbar::CMainToolbar() : m_iToolbarHeight(24), m_dButtonsWidthMax(0)
105{
106}
107
108VOID
110{
111 UINT idButton = (UINT)lpttt->hdr.idFrom;
112
113 switch (idButton)
114 {
115 case ID_EXIT:
116 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_EXIT);
117 break;
118
119 case ID_INSTALL:
120 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_INSTALL);
121 break;
122
123 case ID_UNINSTALL:
124 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_UNINSTALL);
125 break;
126
127 case ID_MODIFY:
128 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_MODIFY);
129 break;
130
131 case ID_SETTINGS:
132 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_SETTINGS);
133 break;
134
135 case ID_REFRESH:
136 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_REFRESH);
137 break;
138
139 case ID_RESETDB:
140 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_UPDATE_DB);
141 break;
142 }
143}
144
145HWND
147{
148 CStringW szInstallBtn;
149 CStringW szUninstallBtn;
150 CStringW szModifyBtn;
151 CStringW szSelectAllBtn;
152 CStringW szRefreshBtn;
153 CStringW szUpdateDbBtn;
154
155 /* Load tooltip strings */
156 szInstallBtn.LoadStringW(IDS_TOOLTIP_INSTALL);
157 szUninstallBtn.LoadStringW(IDS_TOOLTIP_UNINSTALL);
158 szModifyBtn.LoadStringW(IDS_TOOLTIP_MODIFY);
159 szSelectAllBtn.LoadStringW(IDS_TOOLTIP_SELECT_ALL);
160 szRefreshBtn.LoadStringW(IDS_TOOLTIP_REFRESH);
161 szUpdateDbBtn.LoadStringW(IDS_TOOLTIP_UPDATE_DB);
162
163 /* Create buttons */
164 TBBUTTON Buttons[] = {
165 /* iBitmap, idCommand, fsState, fsStyle, bReserved[2], dwData, iString */
166 {0, ID_INSTALL, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, {0}, 0, (INT_PTR)szInstallBtn.GetString()},
167 {1, ID_UNINSTALL, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, {0}, 0, (INT_PTR)szUninstallBtn.GetString()},
168 {2, ID_MODIFY, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, {0}, 0, (INT_PTR)szModifyBtn.GetString()},
169 {3, ID_CHECK_ALL, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, {0}, 0, (INT_PTR)szSelectAllBtn.GetString()},
170 {-1, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0},
171 {4, ID_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, {0}, 0, (INT_PTR)szRefreshBtn.GetString()},
172 {5, ID_RESETDB, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, {0}, 0, (INT_PTR)szUpdateDbBtn.GetString()}};
173
174 m_hWnd = CreateWindowExW(
176 hwndParent, 0, hInst, NULL);
177
178 if (!m_hWnd)
179 {
180 return FALSE;
181 }
182
185
186 /* Set image list */
187 HIMAGELIST hImageList = InitImageList();
188
189 if (hImageList)
190 {
191 ImageList_Destroy(SetImageList(hImageList));
192 }
193
195
196 /* Remember the ideal width to use as a max width of buttons */
198
199 return m_hWnd;
200}
201
202void
204{
205 DWORD dCurrentExStyle = (DWORD)SendMessageW(TB_GETEXTENDEDSTYLE, 0, 0);
206 if (bShow)
208 else
210}
211
212void
214{
215 SIZE size;
218}
219
220DWORD
222{
223 return m_dButtonsWidthMax;
224}
225// **** CMainToolbar ****
226
227// **** CSearchBar ****
228
229CSearchBar::CSearchBar() : m_Width(180), m_Height(22)
230{
231}
232
233VOID
235{
237}
238
239HWND
241{
242 CStringW szBuf;
245 hwndParent, (HMENU)NULL, hInst, 0);
246
248 szBuf.LoadStringW(IDS_SEARCH_TEXT);
249 SetWindowTextW(szBuf);
250 return m_hWnd;
251}
252// **** CSearchBar ****
253
254// **** CComboBox ****
255
256CComboBox::CComboBox() : m_Width(80), m_Height(22)
257{
258}
259
260HWND
262{
266
268
269 for (int i = 0; i < (int)_countof(m_TypeStringID); i++)
270 {
271 CStringW szBuf;
272 szBuf.LoadStringW(m_TypeStringID[i]);
274 }
275
276 SendMessageW(CB_SETCURSEL, m_DefaultSelectType, 0); // select the first item
277
278 return m_hWnd;
279}
280// **** CComboBox ****
281
282// **** CAppRichEdit ****
283
284VOID
285CAppRichEdit::LoadAndInsertText(UINT uStringID, const CStringW &szText, DWORD TextFlags)
286{
287 CStringW szLoadedText;
288 if (!szText.IsEmpty() && szLoadedText.LoadStringW(uStringID))
289 {
290 const DWORD StringFlags = CFE_BOLD;
291 InsertText(szLoadedText, StringFlags);
292 InsertText(szText, TextFlags);
293 }
294}
295
296VOID
298{
299 CStringW szLoadedText;
300 if (szLoadedText.LoadStringW(uStringID))
301 {
302 InsertText(L"\n", 0);
303 InsertText(szLoadedText, StringFlags);
304 InsertText(L"\n", 0);
305 }
306}
307
308VOID
310{
311 if (!Text.IsEmpty())
312 {
313 LoadAndInsertText(StringID, Text, TextFlags);
314 }
315}
316// **** CAppRichEdit ****
317
318int
320{
322 switch (Event)
323 {
324 case ASYNCINET_DATA:
327 break;
332 break;
337 break;
338 case ASYNCINET_ERROR:
341 break;
342 default:
344 break;
345 }
346 return 0;
347}
348
349// **** CAppScrnshotPreview ****
350
351CAppScrnshotPreview::CAppScrnshotPreview(const CStringW &BasePath) : m_BasePath(BasePath)
352{
353}
354
355BOOL
357 HWND hwnd,
358 UINT Msg,
361 LRESULT &theResult,
362 DWORD dwMapId)
363{
364 theResult = 0;
365 switch (Msg)
366 {
367 case WM_CREATE:
370 break;
371 case WM_SIZE:
372 {
374 {
376
377 if (hBrokenImgIcon)
378 {
382 }
383 }
384 break;
385 }
387 {
390 AsyncInet = NULL;
391 switch (wParam)
392 {
393 case ERROR_SUCCESS:
394 if (ContentID == DownloadParam->ID)
395 {
396 DisplayFile(DownloadParam->DownloadFileName);
397 // send a message to trigger resizing
399 InvalidateRect(0, 0);
401 DownloadParam->DownloadFileName; // record tmp file path in order to delete it when cleanup
402 }
403 else
404 {
405 // the picture downloaded is already outdated. delete it.
406 DeleteFileW(DownloadParam->DownloadFileName);
407 }
408 break;
409 case ERROR_CANCELLED:
410 DeleteFileW(DownloadParam->DownloadFileName);
411 break;
412 default:
414 // send a message to trigger resizing
416 InvalidateRect(0, 0);
417 DeleteFileW(DownloadParam->DownloadFileName);
418 break;
419 }
420 delete DownloadParam;
421 break;
422 }
423 case WM_PAINT:
424 {
425 PAINTSTRUCT ps;
426 HDC hdc = BeginPaint(&ps);
427 CRect rect;
429
430 PaintOnDC(hdc, rect.Width(), rect.Height(), ps.fErase);
431
432 EndPaint(&ps);
433 break;
434 }
435 case WM_PRINTCLIENT:
436 {
438 {
439 if (!IsWindowVisible())
440 break;
441 }
442 CRect rect;
444
445 PaintOnDC((HDC)wParam, rect.Width(), rect.Height(), lParam & PRF_ERASEBKGND);
446 break;
447 }
448 case WM_ERASEBKGND:
449 {
450 return TRUE; // do not erase to avoid blinking
451 }
452 case WM_TIMER:
453 {
454 switch (wParam)
455 {
459 HDC hdc = GetDC();
460 CRect rect;
462
463 PaintOnDC(hdc, rect.Width(), rect.Height(), TRUE);
464 ReleaseDC(hdc);
465 }
466 break;
467 }
468 case WM_DESTROY:
469 {
473 break;
474 }
475 }
476 return FALSE;
477}
478
479VOID
481{
483 if (bLoadingTimerOn)
484 {
486 }
490}
491
492VOID
494{
498}
499
500BOOL
502{
505 pImage = Bitmap::FromFile(lpszFileName, 0);
506 if (pImage->GetLastStatus() != Ok)
507 {
509 return FALSE;
510 }
511 return TRUE;
512}
513
514VOID
516{
518}
519
520VOID
522{
523 // use an off screen dc to avoid blinking
527
528 if (bDrawBkgnd)
529 {
530 HBRUSH hOldBrush = (HBRUSH)SelectObject(hdcMem, (HGDIOBJ)GetSysColorBrush(COLOR_BTNFACE));
531 PatBlt(hdcMem, 0, 0, width, height, PATCOPY);
532 SelectObject(hdcMem, hOldBrush);
533 }
534
535 switch (ScrnshotPrevStauts)
536 {
538 {
539 }
540 break;
541
543 {
544 Graphics graphics(hdcMem);
545 Color color(255, 0, 0);
546 SolidBrush dotBrush(Color(255, 100, 100, 100));
547
548 graphics.SetSmoothingMode(SmoothingMode::SmoothingModeAntiAlias);
549
550 // Paint three dot
551 float DotWidth = GetLoadingDotWidth(width, height);
552 graphics.FillEllipse(
553 (Brush *)(&dotBrush), (REAL)width / 2.0 - min(width, height) * 2.0 / 16.0 - DotWidth / 2.0,
554 (REAL)height / 2.0 -
556 DotWidth, DotWidth);
557
558 graphics.FillEllipse(
559 (Brush *)(&dotBrush), (REAL)width / 2.0 - DotWidth / 2.0,
560 (REAL)height / 2.0 - GetFrameDotShift(LoadingAnimationFrame, width, height) - DotWidth / 2.0, DotWidth,
561 DotWidth);
562
563 graphics.FillEllipse(
564 (Brush *)(&dotBrush), (REAL)width / 2.0 + min(width, height) * 2.0 / 16.0 - DotWidth / 2.0,
565 (REAL)height / 2.0 -
567 DotWidth, DotWidth);
568 }
569 break;
570
572 {
573 if (pImage)
574 {
575 // always draw entire image inside the window.
576 Graphics graphics(hdcMem);
577 float ZoomRatio =
578 min(((float)width / (float)pImage->GetWidth()), ((float)height / (float)pImage->GetHeight()));
579 float ZoomedImgWidth = ZoomRatio * (float)pImage->GetWidth();
580 float ZoomedImgHeight = ZoomRatio * (float)pImage->GetHeight();
581
582 graphics.DrawImage(
583 pImage, ((float)width - ZoomedImgWidth) / 2.0, ((float)height - ZoomedImgHeight) / 2.0,
584 ZoomedImgWidth, ZoomedImgHeight);
585 }
586 }
587 break;
588
590 {
594 }
595 break;
596 }
597
598 // copy the content form off-screen dc to hdc
599 BitBlt(hdc, 0, 0, width, height, hdcMem, 0, 0, SRCCOPY);
602}
603
604float
606{
607 return min(width, height) / 20.0;
608}
609
610float
612{
613 return min(width, height) * (1.0 / 16.0) * (2.0 / (2.0 - sqrt(3.0))) *
614 (max(sin((float)Frame * 2 * PI / (LOADING_ANIMATION_PERIOD * LOADING_ANIMATION_FPS)), sqrt(3.0) / 2.0) -
615 sqrt(3.0) / 2.0);
616}
617
620{
621 DWORD csStyle = CS_VREDRAW | CS_HREDRAW;
622 static ATL::CWndClassInfo wc = {
623 {sizeof(WNDCLASSEX), csStyle, StartWindowProc, 0, 0, NULL, 0, LoadCursorW(NULL, IDC_ARROW),
624 (HBRUSH)(COLOR_BTNFACE + 1), 0, L"RAppsScrnshotPreview", NULL},
625 NULL,
626 NULL,
627 IDC_ARROW,
628 TRUE,
629 0,
630 _T("")};
631 return wc;
632}
633
634HWND
636{
637 RECT r = {0, 0, 0, 0};
638
639 return CWindowImpl::Create(hParent, r, L"", WS_CHILD | WS_VISIBLE);
640}
641
642VOID
644{
645 if (bLoadingTimerOn)
646 {
649 }
651 if (pImage)
652 {
653 delete pImage;
654 pImage = NULL;
655 }
656 if (AsyncInet)
657 {
659 }
660 if (!TempImagePath.IsEmpty())
661 {
664 }
665}
666
667VOID
669{
673}
674
675BOOL
677{
680
681 if (PathIsURLW(lpszLocation))
682 {
684
686 if (!DownloadParam)
687 return FALSE;
688
689 DownloadParam->hwndNotify = m_hWnd;
690 DownloadParam->ID = ID;
691 // generate a filename
692 CStringW ScrnshotFolder = m_BasePath;
693 PathAppendW(ScrnshotFolder.GetBuffer(MAX_PATH), L"screenshots");
694 ScrnshotFolder.ReleaseBuffer();
695
696 if (!PathIsDirectoryW(ScrnshotFolder.GetString()))
697 {
698 CreateDirectoryW(ScrnshotFolder.GetString(), NULL);
699 }
700
701 if (!GetTempFileNameW(
702 ScrnshotFolder.GetString(), L"img", 0, DownloadParam->DownloadFileName.GetBuffer(MAX_PATH)))
703 {
704 DownloadParam->DownloadFileName.ReleaseBuffer();
705 delete DownloadParam;
707 return FALSE;
708 }
709 DownloadParam->DownloadFileName.ReleaseBuffer();
710
711 DownloadParam->hFile = CreateFileW(
712 DownloadParam->DownloadFileName.GetString(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL,
713 NULL);
715 {
716 delete DownloadParam;
718 return FALSE;
719 }
720
723 if (!AsyncInet)
724 {
726 DeleteFileW(DownloadParam->DownloadFileName.GetBuffer());
727 delete DownloadParam;
729 return FALSE;
730 }
731 return TRUE;
732 }
733 else
734 {
735 return DisplayFile(lpszLocation);
736 }
737}
738
739int
740CAppScrnshotPreview::GetRequestedWidth(int Height) // calculate requested window width by given height
741{
742 switch (ScrnshotPrevStauts)
743 {
745 return 0;
747 return 200;
749 if (pImage)
750 {
751 // return the width needed to display image inside the window.
752 // and always keep window w/h ratio inside [ 1/SCRNSHOT_MAX_ASPECT_RAT, SCRNSHOT_MAX_ASPECT_RAT ]
753 return (int)floor(
754 (float)Height *
755 max(min((float)pImage->GetWidth() / (float)pImage->GetHeight(), (float)SCRNSHOT_MAX_ASPECT_RAT),
756 1.0 / (float)SCRNSHOT_MAX_ASPECT_RAT));
757 }
758 return 0;
760 return 200;
761 default:
762 return 0;
763 }
764}
765
767{
769}
770// **** CAppScrnshotPreview ****
771
772// **** CAppInfoDisplay ****
773
774BOOL
776 HWND hwnd,
780 LRESULT &theResult,
781 DWORD dwMapId)
782{
783 theResult = 0;
784 switch (message)
785 {
786 case WM_CREATE:
787 {
788 RichEdit = new CAppRichEdit();
790
795 break;
796 }
797 case WM_SIZE:
798 {
800 break;
801 }
803 {
805 break;
806 }
807 case WM_COMMAND:
808 {
810 break;
811 }
812 case WM_NOTIFY:
813 {
814 NMHDR *NotifyHeader = (NMHDR *)lParam;
815 if (NotifyHeader->hwndFrom == RichEdit->m_hWnd)
816 {
817 switch (NotifyHeader->code)
818 {
819 case EN_LINK:
820 OnLink((ENLINK *)lParam);
821 break;
822 }
823 }
824 break;
825 }
827 {
829 break;
830 }
831 }
832
833 return FALSE;
834}
835
836VOID
838{
839 CRect rect;
841 ResizeChildren(rect.Width(), rect.Height());
842}
843
844VOID
846{
847 int ScrnshotWidth = ScrnshotPrev->GetRequestedWidth(Height);
848
849 // make sure richedit always have room to display
850 ScrnshotWidth = min(ScrnshotWidth, Width - INFO_DISPLAY_PADDING - RICHEDIT_MIN_WIDTH);
851
852 DWORD dwError = ERROR_SUCCESS;
853 HDWP hDwp = BeginDeferWindowPos(2);
854
855 if (hDwp)
856 {
857 hDwp = ::DeferWindowPos(hDwp, ScrnshotPrev->m_hWnd, NULL, 0, 0, ScrnshotWidth, Height, 0);
858
859 if (hDwp)
860 {
861 // hide the padding if scrnshot window width == 0
862 int RicheditPosX = ScrnshotWidth ? (ScrnshotWidth + INFO_DISPLAY_PADDING) : 0;
863
864 hDwp = ::DeferWindowPos(hDwp, RichEdit->m_hWnd, NULL, RicheditPosX, 0, Width - RicheditPosX, Height, 0);
865
866 if (hDwp)
867 {
868 EndDeferWindowPos(hDwp);
869 }
870 else
871 {
872 dwError = GetLastError();
873 }
874 }
875 else
876 {
877 dwError = GetLastError();
878 }
879 }
880 else
881 {
882 dwError = GetLastError();
883 }
884
885#if DBG
886 ATLASSERT(dwError == ERROR_SUCCESS);
887#endif
888 UNREFERENCED_PARAMETER(dwError);
889
890 UpdateWindow();
891}
892
893VOID
895{
896 switch (Link->msg)
897 {
898 case WM_LBUTTONUP:
899 case WM_RBUTTONUP:
900 {
901 if (pLink)
903
905 GetProcessHeap(), 0,
906 (max(Link->chrg.cpMin, Link->chrg.cpMax) - min(Link->chrg.cpMin, Link->chrg.cpMax) + 1) *
907 sizeof(WCHAR));
908 if (!pLink)
909 {
910 /* TODO: Error message */
911 return;
912 }
913
914 RichEdit->SendMessageW(EM_SETSEL, Link->chrg.cpMin, Link->chrg.cpMax);
915 RichEdit->SendMessageW(EM_GETSELTEXT, 0, (LPARAM)pLink);
916
917 ShowPopupMenuEx(m_hWnd, m_hWnd, IDR_LINKMENU, -1);
918 }
919 break;
920 }
921}
922
925{
926 DWORD csStyle = CS_VREDRAW | CS_HREDRAW;
927 static ATL::CWndClassInfo wc = {/*.m_wc=*/
928 {/*cbSize=*/sizeof(WNDCLASSEX),
929 /*style=*/csStyle,
930 /*lpfnWndProc=*/StartWindowProc,
931 /*cbClsExtra=*/0,
932 /*cbWndExtra=*/0,
933 /*hInstance=*/NULL,
934 /*hIcon=*/NULL,
935 /*hCursor*/ NULL,
936 /*hbrBackground=*/(HBRUSH)(COLOR_BTNFACE + 1),
937 /*lpszMenuName=*/NULL,
938 /*lpszClassName=*/L"RAppsAppInfo",
939 /*hIconSm=*/NULL},
940 /*m_lpszOrigName=*/NULL,
941 /*pWndProc=*/NULL,
942 /*m_lpszCursorID=*/IDC_ARROW,
943 /*m_bSystemCursor*/ TRUE,
944 /*m_atom=*/0,
945 /*m_szAutoName=*/_T("")};
946 return wc;
947}
948
949HWND
951{
952 RECT r = {0, 0, 0, 0};
953
955}
956
957VOID
959{
960 CStringW ScrnshotLocation;
961 if (Info->RetrieveScreenshot(ScrnshotLocation))
962 {
963 ScrnshotPrev->DisplayImage(ScrnshotLocation);
964 }
965 else
966 {
968 }
970 Info->ShowAppInfo(RichEdit);
971}
972
973void
975{
976 CStringW szText;
977
980
981 // Display the standard banner in normal mode, or
982 // the specific "Add/Remove Programs" in APPWIZ-mode.
983 if (!bAppwiz)
984 {
985 szText.LoadStringW(IDS_WELCOME_TITLE);
986 RichEdit->SetText(szText, CFE_BOLD);
987 RichEdit->InsertText(L"\n\n", 0);
988
989 szText.LoadStringW(IDS_WELCOME_TEXT);
990 RichEdit->InsertText(szText, 0);
991
992 szText.LoadStringW(IDS_WELCOME_URL);
993 RichEdit->InsertText(szText, CFM_LINK);
994 }
995 else
996 {
997 szText.LoadStringW(IDS_APPWIZ_TITLE);
998 RichEdit->SetText(szText, CFE_BOLD);
999 RichEdit->InsertText(L"\n\n", 0);
1000
1001 szText.LoadStringW(IDS_APPWIZ_TEXT1);
1002 RichEdit->InsertText(szText, 0);
1003 RichEdit->InsertText(L"\n", 0);
1004
1005 szText.LoadStringW(IDS_APPWIZ_TEXT2);
1006 RichEdit->InsertText(szText, 0);
1007 }
1008}
1009
1010VOID
1012{
1013 WORD wCommand = LOWORD(wParam);
1014
1015 switch (wCommand)
1016 {
1017 case ID_OPEN_LINK:
1018
1019 ShellExecuteW(m_hWnd, L"open", pLink, NULL, NULL, SW_SHOWNOACTIVATE);
1021 pLink = NULL;
1022 break;
1023
1024 case ID_COPY_LINK:
1027 pLink = NULL;
1028 break;
1029 }
1030}
1031
1033{
1034 delete RichEdit;
1035 delete ScrnshotPrev;
1036}
1037// **** CAppInfoDisplay ****
1038
1039// **** CAppsListView ****
1040
1044 CAppInfo *AppInfo; // Only used to find the item in the list, do not access on background thread
1046 bool Parse;
1048
1049 void Free() { free(this); }
1051 static void StartTasks();
1054
1055static DWORD CALLBACK
1057{
1058 for (CAsyncLoadIcon *task = (CAsyncLoadIcon*)Param, *old; task; old->Free())
1059 {
1060 if (task->TaskId == g_AsyncIconTaskId)
1061 {
1062 HICON hIcon;
1063 if (!task->Parse)
1064 hIcon = (HICON)LoadImageW(NULL, task->Location, IMAGE_ICON, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE);
1065 else if (!ExtractIconExW(task->Location, PathParseIconLocationW(task->Location), &hIcon, NULL, 1))
1066 hIcon = NULL;
1067
1068 if (hIcon)
1069 {
1070 SendMessageW(task->hAppsList, WM_RAPPSLIST_ASYNCICON, (WPARAM)hIcon, (LPARAM)task);
1072 }
1073 }
1074 old = task;
1075 task = task->pNext;
1076 }
1077 return 0;
1078}
1079
1081CAsyncLoadIcon::Queue(HWND hAppsList, CAppInfo &AppInfo, bool Parse)
1082{
1084 CStringW szIconPath;
1085 if (!AppInfo.RetrieveIcon(szIconPath))
1086 return NULL;
1087 SIZE_T cbstr = (szIconPath.GetLength() + 1) * sizeof(WCHAR);
1088 CAsyncLoadIcon *task = (CAsyncLoadIcon*)malloc(sizeof(CAsyncLoadIcon) + cbstr);
1089 if (!task)
1090 return NULL;
1091 task->hAppsList = hAppsList;
1092 task->AppInfo = &AppInfo;
1093 task->TaskId = g_AsyncIconTaskId;
1094 task->Parse = Parse;
1095 CopyMemory(task->Location, szIconPath.GetBuffer(), cbstr);
1096 szIconPath.ReleaseBuffer();
1097 task->pNext = g_AsyncIconTasks;
1098 g_AsyncIconTasks = task;
1099 return task;
1100}
1101
1102void
1104{
1107 if (HANDLE hThread = CreateThread(NULL, 0, AsyncLoadIconProc, tasks, 0, NULL))
1109 else
1110 AsyncLoadIconProc(tasks); // Insist so we at least free the tasks
1111}
1112
1114{
1115 m_hImageListView = 0;
1116}
1117
1119{
1120 if (m_hImageListView)
1124}
1125
1126LRESULT
1128{
1129 LRESULT lRes = this->DefWindowProc(uMsg, wParam, lParam);
1130 if (!m_Watermark.IsEmpty())
1131 {
1132 RECT rc;
1133 GetClientRect(&rc);
1139 SelectFont(HDC(wParam), oldFont);
1140 }
1141 return lRes;
1142}
1143
1144LRESULT
1146{
1148 bHandled = TRUE;
1149 if (task->TaskId == g_AsyncIconTaskId)
1150 {
1151 LVITEM lvi;
1152 LVFINDINFO lvfi;
1153 lvfi.flags = LVFI_PARAM;
1154 lvfi.lParam = (LPARAM)task->AppInfo;
1155 lvi.iItem = ListView_FindItem(m_hWnd, -1, &lvfi);
1156 if (lvi.iItem != -1)
1157 {
1159 if (lvi.iImage != -1)
1160 {
1161 lvi.mask = LVIF_IMAGE;
1162 lvi.iSubItem = 0;
1163 ListView_SetItem(m_hWnd, &lvi);
1164 }
1165 }
1166 }
1167 return 0;
1168}
1169
1170VOID
1172{
1173 m_Watermark = Text;
1174}
1175
1176void
1178{
1179 SetExtendedListViewStyle((bShow ? LVS_EX_CHECKBOXES : 0) | LVS_EX_FULLROWSELECT);
1180 bHasCheckboxes = bShow;
1181}
1182
1183VOID
1185{
1186 HWND hHeader;
1187 HDITEMW hColumn;
1188 INT nHeaderID = pnmv->iSubItem;
1189
1191 return;
1192
1193 hHeader = (HWND)SendMessage(LVM_GETHEADER, 0, 0);
1194 ZeroMemory(&hColumn, sizeof(hColumn));
1195
1196 /* If the sorting column changed, remove the sorting style from the old column */
1197 if ((nLastHeaderID != -1) && (nLastHeaderID != nHeaderID))
1198 {
1199 bIsAscending = TRUE; // also reset sorting method to ascending
1200 hColumn.mask = HDI_FORMAT;
1201 Header_GetItem(hHeader, nLastHeaderID, &hColumn);
1202 hColumn.fmt &= ~(HDF_SORTUP | HDF_SORTDOWN);
1203 Header_SetItem(hHeader, nLastHeaderID, &hColumn);
1204 }
1205
1206 /* Set the sorting style to the new column */
1207 hColumn.mask = HDI_FORMAT;
1208 Header_GetItem(hHeader, nHeaderID, &hColumn);
1209
1210 hColumn.fmt &= ~(HDF_SORTDOWN | HDF_SORTUP);
1211 hColumn.fmt |= (bIsAscending ? HDF_SORTUP : HDF_SORTDOWN);
1212 Header_SetItem(hHeader, nHeaderID, &hColumn);
1213
1214 /* Sort the list, using the current values of nHeaderID and bIsAscending */
1215 SortContext ctx = {this, nHeaderID};
1216 SortItems(s_CompareFunc, &ctx);
1217
1218 /* Save new values */
1219 nLastHeaderID = nHeaderID;
1221}
1222
1223BOOL
1225{
1226 LVCOLUMNW Column;
1227
1228 ZeroMemory(&Column, sizeof(Column));
1229
1231 Column.iSubItem = Index;
1232 Column.pszText = const_cast<LPWSTR>(Text.GetString());
1233 Column.cx = Width;
1234 Column.fmt = Format;
1235
1236 return SendMessage(LVM_INSERTCOLUMN, Index, (LPARAM)(&Column));
1237}
1238
1239void
1241{
1243 return;
1244}
1245
1246INT
1248{
1249 LVITEMW Item;
1250
1251 ZeroMemory(&Item, sizeof(Item));
1252
1254 Item.pszText = const_cast<LPWSTR>(lpText);
1255 Item.lParam = lParam;
1256 Item.iItem = ItemIndex;
1257 Item.iImage = IconIndex;
1258
1259 if (IconIndex >= 0)
1260 {
1261 Item.iImage = IconIndex;
1262 Item.mask |= LVIF_IMAGE;
1263 }
1264 return InsertItem(&Item);
1265}
1266
1269{
1270 return (HIMAGELIST)SendMessage(LVM_GETIMAGELIST, iImageList, 0);
1271}
1272
1275{
1276 SortContext *ctx = ((SortContext *)lParamSort);
1277 return ctx->lvw->CompareFunc(lParam1, lParam2, ctx->iSubItem);
1278}
1279
1280INT
1281CAppsListView::CompareFunc(LPARAM lParam1, LPARAM lParam2, INT iSubItem)
1282{
1283 CStringW Item1, Item2;
1284 LVFINDINFOW IndexInfo;
1285 INT Index;
1286
1287 IndexInfo.flags = LVFI_PARAM;
1288
1289 IndexInfo.lParam = lParam1;
1290 Index = FindItem(-1, &IndexInfo);
1291 GetItemText(Index, iSubItem, Item1.GetBuffer(MAX_STR_LEN), MAX_STR_LEN);
1292 Item1.ReleaseBuffer();
1293
1294 IndexInfo.lParam = lParam2;
1295 Index = FindItem(-1, &IndexInfo);
1296 GetItemText(Index, iSubItem, Item2.GetBuffer(MAX_STR_LEN), MAX_STR_LEN);
1297 Item2.ReleaseBuffer();
1298
1299 return bIsAscending ? Item1.Compare(Item2) : Item2.Compare(Item1);
1300}
1301
1302HWND
1304{
1305 RECT r = {205, 28, 465, 250};
1308
1310
1311 if (hwnd)
1312 {
1313 ShowCheckboxes(false);
1314 }
1315
1316#pragma push_macro("SubclassWindow")
1317#undef SubclassWindow
1318 m_hWnd = NULL;
1320#pragma pop_macro("SubclassWindow")
1321
1322 return hwnd;
1323}
1324
1325BOOL
1327{
1328 return (BOOL)(GetItemState(item, LVIS_STATEIMAGEMASK) >> 12) - 1;
1329}
1330
1331VOID
1333{
1334 if (bHasCheckboxes)
1335 {
1336 SetItemState(item, INDEXTOSTATEIMAGEMASK((fCheck) ? 2 : 1), LVIS_STATEIMAGEMASK);
1337 }
1338}
1339
1340VOID
1342{
1343 if (bHasCheckboxes)
1344 {
1346 {
1347 // clear all
1348 SetCheckState(-1, FALSE);
1349 }
1350 else
1351 {
1352 // check all
1353 SetCheckState(-1, TRUE);
1354 }
1355 }
1356}
1357
1358PVOID
1360{
1361 INT item = GetSelectionMark();
1362 if (item == -1)
1363 {
1364 return (PVOID)0;
1365 }
1366 return (PVOID)GetItemData(item);
1367}
1368
1369BOOL
1371{
1372 ++g_AsyncIconTaskId; // Stop loading icons that are now invalid
1373 if (!DeleteAllItems())
1374 return FALSE;
1375
1376 ApplicationViewType = AppType;
1378 ItemCount = 0;
1379 CheckedItemCount = 0;
1380
1381 ListView_Scroll(m_hWnd, 0, 0x7fff * -1); // FIXME: a bug in Wine ComCtl32 where VScroll is not reset after deleting items
1382
1383 // delete old columns
1384 while (ColumnCount)
1385 {
1387 }
1388
1390 {
1392 UINT IconSize = GetSystemMetrics(SM_CXICON);
1394 m_hImageListView = ImageList_Create(IconSize, IconSize, ilc, 0, 1);
1398 IMAGE_ICON, IconSize, IconSize, LR_SHARED);
1399 }
1401
1403 if (g_DefaultPackageIconILIdx == -1)
1405
1406 // add new columns
1407 CStringW szText;
1408 switch (AppType)
1409 {
1411
1412 /* Add columns to ListView */
1413 szText.LoadStringW(IDS_APP_NAME);
1414 AddColumn(ColumnCount++, szText, 368, LVCFMT_LEFT);
1415
1416 szText.LoadStringW(IDS_APP_INST_VERSION);
1417 AddColumn(ColumnCount++, szText, 90, LVCFMT_RIGHT);
1418
1419#if 0 // This column is not currently useful for installed apps.
1420 szText.LoadStringW(IDS_APP_DESCRIPTION);
1421 AddColumn(ColumnCount++, szText, 300, LVCFMT_LEFT);
1422#endif
1423
1424 // Disable checkboxes
1425 ShowCheckboxes(false);
1426 break;
1427
1429
1430 /* Add columns to ListView */
1431 szText.LoadStringW(IDS_APP_NAME);
1432 AddColumn(ColumnCount++, szText, 250, LVCFMT_LEFT);
1433
1434 szText.LoadStringW(IDS_APP_INST_VERSION);
1435 AddColumn(ColumnCount++, szText, 90, LVCFMT_RIGHT);
1436
1437 szText.LoadStringW(IDS_APP_DESCRIPTION);
1438 AddColumn(ColumnCount++, szText, 300, LVCFMT_LEFT);
1439
1440 // Enable checkboxes
1441 ShowCheckboxes(true);
1442 break;
1443
1444 default:
1445 break;
1446 }
1447
1448 return TRUE;
1449}
1450
1451BOOL
1453{
1454 return SendMessage(LVM_SETVIEW, (WPARAM)ViewMode, 0) == 1;
1455}
1456
1457BOOL
1458CAppsListView::AddApplication(CAppInfo *AppInfo, BOOL InitialCheckState)
1459{
1460 if (!AppInfo)
1461 {
1463 return TRUE;
1464 }
1465
1468 {
1469 int Index = AddItem(ItemCount, IconIndex, AppInfo->szDisplayName, (LPARAM)AppInfo);
1470 if (Index == -1)
1471 return FALSE;
1472 CAsyncLoadIcon::Queue(m_hWnd, *AppInfo, true);
1473
1474 SetItemText(Index, 1, AppInfo->szDisplayVersion.IsEmpty() ? L"---" : AppInfo->szDisplayVersion);
1475 SetItemText(Index, 2, AppInfo->szComments.IsEmpty() ? L"---" : AppInfo->szComments);
1476
1477 ItemCount++;
1478 return TRUE;
1479 }
1481 {
1482 int Index = AddItem(ItemCount, IconIndex, AppInfo->szDisplayName, (LPARAM)AppInfo);
1483 if (Index == -1)
1484 return FALSE;
1485 CAsyncLoadIcon::Queue(m_hWnd, *AppInfo, false);
1486
1487 if (InitialCheckState)
1488 {
1490 }
1491
1492 SetItemText(Index, 1, AppInfo->szDisplayVersion);
1493 SetItemText(Index, 2, AppInfo->szComments);
1494
1495 ItemCount++;
1496 return TRUE;
1497 }
1498 else
1499 {
1500 return FALSE;
1501 }
1502}
1503
1504// this function is called when parent window receiving an notification about checkstate changing
1505VOID
1507{
1508 if (bCheck)
1509 {
1511 }
1512 else
1513 {
1515 }
1516}
1517// **** CAppsListView ****
1518
1519// **** CApplicationView ****
1520
1521BOOL
1523 HWND hwnd,
1524 UINT message,
1525 WPARAM wParam,
1526 LPARAM lParam,
1527 LRESULT &theResult,
1528 DWORD dwMapId)
1529{
1530 theResult = 0;
1531 switch (message)
1532 {
1533 case WM_CREATE:
1534 {
1535 BOOL bSuccess = TRUE;
1536 m_Panel = new CUiPanel();
1539
1546
1547 /* APPWIZ-mode: Remove the unneeded menu items and toolbar buttons */
1549 {
1550 HMENU hMenu;
1551
1552 /* Delete the "Settings" item in the "File" sub-menu */
1553 hMenu = ::GetSubMenu(m_MainWindow->GetMenu(), 0);
1555
1556 /* Remove the menu items: ID_INSTALL, ID_RESETDB */
1557 hMenu = GetMenu();
1560
1561 /* Remove the toolbar buttons:
1562 * ID_INSTALL, ID_CHECK_ALL, ID_RESETDB
1563 * We only keep:
1564 * ID_UNINSTALL, ID_MODIFY, ID_REFRESH */
1565 TBBUTTONINFO info = { sizeof(info), 0 };
1566 int index;
1567
1569 if (index >= 0) m_Toolbar->DeleteButton(index);
1570
1572 if (index >= 0) m_Toolbar->DeleteButton(index);
1573
1575 if (index >= 0) m_Toolbar->DeleteButton(index);
1576
1577 /* Update the ideal width to use as a max width of buttons */
1579 }
1580
1581 /* Resize the toolbar */
1583
1584 RECT rTop;
1585
1586 ::GetWindowRect(m_Toolbar->m_hWnd, &rTop);
1587 m_HSplitter->m_Margin.top = rTop.bottom - rTop.top;
1588 if (!bSuccess)
1589 {
1590 return -1; // creation failure
1591 }
1592 }
1593 break;
1594
1595 case WM_NOTIFY:
1596 {
1597 LPNMHDR pNotifyHeader = (LPNMHDR)lParam;
1598 if (pNotifyHeader->hwndFrom == m_ListView->GetWindow())
1599 {
1600 switch (pNotifyHeader->code)
1601 {
1602 case LVN_ITEMCHANGED:
1603 {
1605
1606 /* Check if this is a valid item
1607 * (technically, it can be also an unselect) */
1608 INT ItemIndex = pnic->iItem;
1609 if (ItemIndex == -1 || ItemIndex >= ListView_GetItemCount(pnic->hdr.hwndFrom))
1610 {
1611 break;
1612 }
1613
1614 /* Check if the focus has been moved to another item */
1615 if ((pnic->uChanged & LVIF_STATE) && (pnic->uNewState & LVIS_FOCUSED) &&
1616 !(pnic->uOldState & LVIS_FOCUSED))
1617 {
1618 ItemGetFocus((LPVOID)pnic->lParam);
1619 }
1620
1621 /* Check if the item is checked/unchecked */
1622 if (pnic->uChanged & LVIF_STATE)
1623 {
1624 int iOldState = STATEIMAGETOINDEX(pnic->uOldState);
1625 int iNewState = STATEIMAGETOINDEX(pnic->uNewState);
1626
1627 if (iOldState == STATEIMAGE_UNCHECKED && iNewState == STATEIMAGE_CHECKED)
1628 {
1629 // this item is just checked
1632 }
1633 else if (iOldState == STATEIMAGE_CHECKED && iNewState == STATEIMAGE_UNCHECKED)
1634 {
1635 // this item is just unchecked
1638 }
1639 }
1640 }
1641 break;
1642
1643 case LVN_COLUMNCLICK:
1644 {
1646
1647 m_ListView->ColumnClick(pnmv);
1648 }
1649 break;
1650
1651 case NM_DBLCLK:
1652 {
1654 if (Item->iItem != -1)
1655 {
1656 /* this won't do anything if the program is already installed */
1657
1659 {
1661 (CAppInfo *)m_ListView->GetItemData(Item->iItem));
1662 }
1663 }
1664 }
1665 break;
1666 }
1667 }
1668 else if (pNotifyHeader->hwndFrom == m_Toolbar->GetWindow())
1669 {
1670 switch (pNotifyHeader->code)
1671 {
1672 case TTN_GETDISPINFO:
1674 break;
1675 }
1676 }
1677 }
1678 break;
1679
1680 case WM_SYSCOLORCHANGE:
1681 {
1682 /* Forward WM_SYSCOLORCHANGE to common controls */
1683 m_ListView->SendMessageW(WM_SYSCOLORCHANGE, wParam, lParam);
1684 m_AppsInfo->SendMessageW(WM_SYSCOLORCHANGE, wParam, lParam);
1685 m_Toolbar->SendMessageW(WM_SYSCOLORCHANGE, wParam, lParam);
1686 m_ComboBox->SendMessageW(WM_SYSCOLORCHANGE, wParam, lParam);
1687 }
1688 break;
1689
1690 case WM_SIZE:
1691 {
1693 break;
1694 }
1695
1696 case WM_COMMAND:
1697 {
1699 }
1700 break;
1701
1702 case WM_CONTEXTMENU:
1703 {
1704 bool kbd = -1 == (int)(INT_PTR)lParam;
1705 if ((HWND)wParam == m_ListView->m_hWnd)
1706 {
1707 int item = m_ListView->GetNextItem(-1, LVNI_FOCUSED | LVNI_SELECTED);
1708 if (item != -1)
1709 {
1710 POINT *ppt = NULL, pt;
1711 if (kbd)
1712 {
1713 RECT r;
1715 pt.x = r.left + (r.right - r.left) / 2;
1716 pt.y = r.top + (r.bottom - r.top) / 2;
1717 ::ClientToScreen((HWND)wParam, ppt = &pt);
1718 }
1719 ShowPopupMenuEx(m_hWnd, m_hWnd, 0, ID_INSTALL, ppt);
1720 return TRUE;
1721 }
1722 }
1723 }
1724 break;
1725 }
1726 return FALSE;
1727}
1728
1729BOOL
1731{
1732 m_Toolbar = new CMainToolbar();
1736
1737 return m_Toolbar->Create(m_hWnd) != NULL;
1738}
1739
1740BOOL
1742{
1748
1749 return m_SearchBar->Create(m_Toolbar->m_hWnd) != NULL;
1750}
1751
1752BOOL
1754{
1758 m_ComboBox->m_Margin.top = 4;
1759
1760 return m_ComboBox->Create(m_Toolbar->m_hWnd) != NULL;
1761}
1762
1763BOOL
1765{
1766 m_HSplitter = new CUiSplitPanel();
1771 m_HSplitter->m_Pos = INT_MAX; // set INT_MAX to use lowest possible position (m_MinSecond)
1772 m_HSplitter->m_MinFirst = 10;
1773 m_HSplitter->m_MinSecond = 140;
1775
1776 return m_HSplitter->Create(m_hWnd) != NULL;
1777}
1778
1779BOOL
1781{
1782 m_ListView = new CAppsListView();
1786
1787 return m_ListView->Create(m_hWnd) != NULL;
1788}
1789
1790BOOL
1792{
1797
1798 return m_AppsInfo->Create(m_hWnd) != NULL;
1799}
1800
1801void
1803{
1804 CWindow::SetRedraw(bRedraw);
1805 m_ListView->SetRedraw(bRedraw);
1806}
1807
1808void
1810{
1812}
1813
1814VOID
1816{
1817 if (wParam == SIZE_MINIMIZED)
1818 return;
1819
1820 /* Resize the toolbar */
1822
1823 /* Automatically hide captions */
1824 DWORD dToolbarTreshold = m_Toolbar->GetMaxButtonsWidth();
1825 DWORD dSearchbarMargin = (LOWORD(lParam) - m_SearchBar->m_Width - m_ComboBox->m_Width - TOOLBAR_PADDING * 2);
1826
1827 if (dSearchbarMargin > dToolbarTreshold)
1828 {
1830 }
1831 else if (dSearchbarMargin < dToolbarTreshold)
1832 {
1834 }
1835
1836 RECT r = {0, 0, LOWORD(lParam), HIWORD(lParam)};
1837 HDWP hdwp = NULL;
1839
1840 hdwp = BeginDeferWindowPos(count);
1841 if (hdwp)
1842 {
1843 hdwp = m_Panel->OnParentSize(r, hdwp);
1844 if (hdwp)
1845 {
1846 EndDeferWindowPos(hdwp);
1847 }
1848 }
1849
1851 hdwp = BeginDeferWindowPos(count);
1852 if (hdwp)
1853 {
1854 hdwp = m_SearchBar->OnParentSize(r, hdwp);
1855 if (hdwp)
1856 {
1857 EndDeferWindowPos(hdwp);
1858 }
1859 }
1860
1863 hdwp = BeginDeferWindowPos(count);
1864 if (hdwp)
1865 {
1866 hdwp = m_ComboBox->OnParentSize(r, hdwp);
1867 if (hdwp)
1868 {
1869 EndDeferWindowPos(hdwp);
1870 }
1871 }
1872}
1873
1874VOID
1876{
1877 if (lParam)
1878 {
1879 if ((HWND)lParam == m_SearchBar->GetWindow())
1880 {
1881 CStringW szBuf;
1882 switch (HIWORD(wParam))
1883 {
1884 case EN_SETFOCUS:
1885 {
1886 CStringW szWndText;
1887
1888 szBuf.LoadStringW(IDS_SEARCH_TEXT);
1889 m_SearchBar->GetWindowTextW(szWndText);
1890 if (szBuf == szWndText)
1891 {
1892 m_SearchBar->SetWindowTextW(L"");
1893 }
1894 }
1895 break;
1896
1897 case EN_KILLFOCUS:
1898 {
1900 if (szBuf.IsEmpty())
1901 {
1902 szBuf.LoadStringW(IDS_SEARCH_TEXT);
1903 m_SearchBar->SetWindowTextW(szBuf.GetString());
1904 }
1905 }
1906 break;
1907
1908 case EN_CHANGE:
1909 {
1910 CStringW szWndText;
1911
1912 szBuf.LoadStringW(IDS_SEARCH_TEXT);
1913 m_SearchBar->GetWindowTextW(szWndText);
1914 if (szBuf == szWndText)
1915 {
1916 szWndText = L"";
1917 m_MainWindow->SearchTextChanged(szWndText);
1918 }
1919 else
1920 {
1921 m_MainWindow->SearchTextChanged(szWndText);
1922 }
1923 }
1924 break;
1925 }
1926
1927 return;
1928 }
1929 else if ((HWND)lParam == m_ComboBox->GetWindow())
1930 {
1931 int NotifyCode = HIWORD(wParam);
1932 switch (NotifyCode)
1933 {
1934 case CBN_SELCHANGE:
1935 int CurrSelection = m_ComboBox->SendMessageW(CB_GETCURSEL);
1936
1937 int ViewModeList[] = {LV_VIEW_DETAILS, LV_VIEW_LIST, LV_VIEW_TILE};
1938 ATLASSERT(CurrSelection < (int)_countof(ViewModeList));
1939 if (!m_ListView->SetViewMode(ViewModeList[CurrSelection]))
1940 {
1941 MessageBoxW(L"View mode invalid or unimplemented");
1942 }
1943 break;
1944 }
1945
1946 return;
1947 }
1948 else if ((HWND)lParam == m_Toolbar->GetWindow())
1949 {
1950 // the message is sent from Toolbar. fall down to continue process
1951 }
1952 else
1953 {
1954 return;
1955 }
1956 }
1957
1958 // the LOWORD of wParam contains a Menu or Control ID
1959 WORD wCommand = LOWORD(wParam);
1960
1961 switch (wCommand)
1962 {
1963 case ID_INSTALL:
1964 case ID_UNINSTALL:
1965 case ID_MODIFY:
1966 case ID_REGREMOVE:
1967 case ID_REFRESH:
1968 case ID_RESETDB:
1969 case ID_CHECK_ALL:
1970 m_MainWindow->SendMessageW(WM_COMMAND, wCommand, 0);
1971 break;
1972 }
1973}
1974
1975CApplicationView::CApplicationView(CMainWindow *MainWindow) : m_MainWindow(MainWindow)
1976{
1977}
1978
1980{
1981 delete m_Toolbar;
1982 delete m_SearchBar;
1983 delete m_ListView;
1984 delete m_AppsInfo;
1985 delete m_HSplitter;
1986}
1987
1990{
1991 DWORD csStyle = CS_VREDRAW | CS_HREDRAW;
1992 static ATL::CWndClassInfo wc = {
1993 {sizeof(WNDCLASSEX), csStyle, StartWindowProc, 0, 0, NULL, NULL, NULL, (HBRUSH)(COLOR_BTNFACE + 1), NULL,
1994 L"RAppsApplicationView", NULL},
1995 NULL,
1996 NULL,
1997 IDC_ARROW,
1998 TRUE,
1999 0,
2000 _T("")};
2001 return wc;
2002}
2003
2004HWND
2006{
2007 RECT r = {0, 0, 0, 0};
2008
2009 // Pick the "Programs" sub-menu for building the context menu.
2010 HMENU hMenu = ::GetSubMenu(m_MainWindow->GetMenu(), 1);
2011
2013}
2014
2015BOOL
2017{
2018 if (!m_ListView->SetDisplayAppType(AppType))
2019 {
2020 return FALSE;
2021 }
2022 ApplicationViewType = AppType;
2024
2025 HMENU hMenu = ::GetMenu(m_hWnd);
2026 switch (AppType)
2027 {
2029 {
2034
2035 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_INSTALL, FALSE);
2036 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_UNINSTALL, TRUE);
2037 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_MODIFY, TRUE);
2039 break;
2040 }
2041
2043 {
2044 // We shouldn't get there in APPWIZ-mode.
2046
2051
2052 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_INSTALL, TRUE);
2054 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_MODIFY, FALSE);
2055 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_CHECK_ALL, TRUE);
2056 break;
2057 }
2058 }
2059 return TRUE;
2060}
2061
2062BOOL
2064{
2065 return m_ListView->AddApplication(AppInfo, InitialCheckState);
2066}
2067
2068VOID
2070{
2072}
2073
2074void
2076{
2078}
2079
2080PVOID
2082{
2084}
2085
2086int
2088{
2089 return m_ListView->GetItemCount();
2090}
2091
2092VOID
2094{
2100}
2101
2102VOID
2104{
2105 LVITEMW &Item = Restore.Item;
2107 Item.iItem = -1, Item.iSubItem = 0;
2108 Item.stateMask = LVIS_FOCUSED|LVIS_SELECTED;
2109 Item.pszText = Restore.Name, Item.cchTextMax = _countof(Restore.Name);
2110
2111 HWND hList = m_ListView ? m_ListView->m_hWnd : NULL;
2112 if (hList)
2113 {
2116 }
2117}
2118
2119VOID
2121{
2122 const LVITEMW &Item = Restore.Item;
2123 int index = Item.iItem;
2124 if (index != -1) // Was there a selected item?
2125 {
2126 LVFINDINFOW fi;
2127 fi.flags = LVFI_STRING;
2128 fi.psz = Item.pszText;
2129 index = ListView_FindItem(m_ListView->m_hWnd, -1, &fi);
2130 }
2131 if (index != -1) // Is it still in the list?
2132 {
2133 ListView_SetItemState(m_ListView->m_hWnd, index, Item.state, Item.stateMask);
2134 }
2135}
2136
2137// this function is called when a item of listview get focus.
2138// CallbackParam is the param passed to listview when adding the item (the one getting focus now).
2139VOID
2141{
2142 if (CallbackParam)
2143 {
2144 CAppInfo *Info = static_cast<CAppInfo *>(CallbackParam);
2146
2148 {
2149 HMENU hMenu = ::GetMenu(m_hWnd);
2150
2151 BOOL CanModify = Info->CanModify();
2152
2153 EnableMenuItem(hMenu, ID_MODIFY, CanModify ? MF_ENABLED : MF_GRAYED);
2154 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_MODIFY, CanModify);
2155 }
2156 }
2157}
2158
2159// this function is called when a item of listview is checked/unchecked
2160// CallbackParam is the param passed to listview when adding the item (the one getting changed now).
2161VOID
2163{
2164 m_MainWindow->ItemCheckStateChanged(bChecked, CallbackParam);
2165}
2166// **** 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:319
BOOL DeleteMenuEx(_In_ HMENU hMenu, _In_ UINT uPosition, _In_ UINT uFlags)
Definition: appview.cpp:22
static UINT g_AsyncIconTaskId
Definition: appview.cpp:1053
static DWORD CALLBACK AsyncLoadIconProc(LPVOID Param)
Definition: appview.cpp:1056
struct CAsyncLoadIcon * g_AsyncIconTasks
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:319
#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:170
VOID ShowPopupMenuEx(HWND hwnd, HWND hwndOwner, UINT MenuID, UINT DefaultItem, POINT *Point=NULL)
Definition: misc.cpp:68
INT GetSystemColorDepth()
Definition: misc.cpp:328
VOID CopyTextToClipboard(LPCWSTR lpszText)
Definition: misc.cpp:16
#define ID_REGREMOVE
Definition: resource.h:82
#define IDS_TOOLTIP_UPDATE_DB
Definition: resource.h:139
#define IDS_APP_DESCRIPTION
Definition: resource.h:144
#define IDS_TOOLTIP_INSTALL
Definition: resource.h:132
#define IDS_SEARCH_TEXT
Definition: resource.h:101
#define ID_UNINSTALL
Definition: resource.h:74
#define IDI_UPDATE_DB
Definition: resource.h:14
#define IDS_WELCOME_TITLE
Definition: resource.h:93
#define ID_COPY_LINK
Definition: resource.h:79
#define IDS_WELCOME_TEXT
Definition: resource.h:94
#define IDS_APPWIZ_TEXT1
Definition: resource.h:97
#define IDS_TOOLTIP_SETTINGS
Definition: resource.h:136
#define IDI_EXIT
Definition: resource.h:5
#define IDI_BROKEN_IMAGE
Definition: resource.h:17
#define IDI_MODIFY
Definition: resource.h:9
#define IDS_APP_INST_VERSION
Definition: resource.h:143
#define IDR_LINKMENU
Definition: resource.h:69
#define ID_CHECK_ALL
Definition: resource.h:84
#define IDI_CHECK_ALL
Definition: resource.h:15
#define IDS_TOOLTIP_MODIFY
Definition: resource.h:134
#define IDI_INSTALL
Definition: resource.h:6
#define IDI_SETTINGS
Definition: resource.h:8
#define ID_MODIFY
Definition: resource.h:77
#define ID_OPEN_LINK
Definition: resource.h:78
#define IDI_UNINSTALL
Definition: resource.h:7
#define IDS_TOOLTIP_UNINSTALL
Definition: resource.h:133
#define IDS_TOOLTIP_SELECT_ALL
Definition: resource.h:135
#define ID_RESETDB
Definition: resource.h:83
#define IDS_APPWIZ_TEXT2
Definition: resource.h:98
#define IDS_APP_NAME
Definition: resource.h:142
#define IDS_TOOLTIP_EXIT
Definition: resource.h:138
#define IDS_APPWIZ_TITLE
Definition: resource.h:96
#define ID_INSTALL
Definition: resource.h:73
#define IDS_WELCOME_URL
Definition: resource.h:95
#define ID_SETTINGS
Definition: resource.h:80
#define IDI_REFRESH
Definition: resource.h:10
#define InterlockedIncrement64(a)
Definition: btrfs_drv.h:143
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 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:1011
HWND Create(HWND hwndParent)
Definition: appview.cpp:950
VOID ShowAppInfo(CAppInfo *Info)
Definition: appview.cpp:958
BOOL ProcessWindowMessage(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId)
Definition: appview.cpp:775
VOID OnLink(ENLINK *Link)
Definition: appview.cpp:894
VOID ResizeChildren()
Definition: appview.cpp:837
CAppRichEdit * RichEdit
Definition: appview.h:168
void SetWelcomeText(bool bAppwiz)
Definition: appview.cpp:974
CAppScrnshotPreview * ScrnshotPrev
Definition: appview.h:169
LPWSTR pLink
Definition: appview.h:154
static ATL::CWndClassInfo & GetWndClassInfo()
Definition: appview.cpp:924
virtual BOOL RetrieveIcon(CStringW &Path) const =0
CStringW szDisplayName
Definition: appinfo.h:102
VOID InsertTextWithString(UINT StringID, const CStringW &Text, DWORD TextFlags)
Definition: appview.cpp:309
VOID LoadAndInsertText(UINT uStringID, const CStringW &szText, DWORD TextFlags)
Definition: appview.cpp:285
float GetLoadingDotWidth(int width, int height)
Definition: appview.cpp:605
CAppScrnshotPreview(const CStringW &BasePath)
Definition: appview.cpp:351
VOID PreviousDisplayCleanup()
Definition: appview.cpp:643
VOID SetStatus(SCRNSHOT_STATUS Status)
Definition: appview.cpp:515
SCRNSHOT_STATUS ScrnshotPrevStauts
Definition: appview.h:101
BOOL DisplayFile(LPCWSTR lpszFileName)
Definition: appview.cpp:501
VOID PaintOnDC(HDC hdc, int width, int height, BOOL bDrawBkgnd)
Definition: appview.cpp:521
BOOL ProcessWindowMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId)
Definition: appview.cpp:356
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:635
float GetFrameDotShift(int Frame, int width, int height)
Definition: appview.cpp:611
BOOL DisplayImage(LPCWSTR lpszLocation)
Definition: appview.cpp:676
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:619
int GetRequestedWidth(int Height)
Definition: appview.cpp:740
BOOL CreateToolbar()
Definition: appview.cpp:1730
PVOID GetFocusedItemData()
Definition: appview.cpp:2081
VOID ItemGetFocus(LPVOID CallbackParam)
Definition: appview.cpp:2140
BOOL CreateHSplitter()
Definition: appview.cpp:1764
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:356
HWND Create(HWND hwndParent)
Definition: appview.cpp:2005
BOOL CreateAppInfoDisplay()
Definition: appview.cpp:1791
VOID OnCommand(WPARAM wParam, LPARAM lParam)
Definition: appview.cpp:1875
static ATL::CWndClassInfo & GetWndClassInfo()
Definition: appview.cpp:1989
CUiPanel * m_Panel
Definition: appview.h:348
VOID GetRestoreListSelectionData(RESTORELISTSELECTION &Restore)
Definition: appview.cpp:2103
CUiWindow< CComboBox > * m_ComboBox
Definition: appview.h:350
VOID RestoreListSelection(const RESTORELISTSELECTION &Restore)
Definition: appview.cpp:2120
CUiWindow< CSearchBar > * m_SearchBar
Definition: appview.h:351
BOOL AddApplication(CAppInfo *InstAppInfo, BOOL InitialCheckState)
Definition: appview.cpp:2063
BOOL ProcessWindowMessage(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId)
Definition: appview.cpp:1522
BOOL SetDisplayAppType(APPLICATION_VIEW_TYPE AppType)
Definition: appview.cpp:2016
CApplicationView(CMainWindow *MainWindow)
Definition: appview.cpp:1975
CMainWindow * m_MainWindow
Definition: appview.h:355
CAppInfoDisplay * m_AppsInfo
Definition: appview.h:353
void SetFocusOnSearchBar()
Definition: appview.cpp:1809
VOID OnSize(HWND hwnd, WPARAM wParam, LPARAM lParam)
Definition: appview.cpp:1815
CUiSplitPanel * m_HSplitter
Definition: appview.h:354
void SetRedraw(BOOL bRedraw)
Definition: appview.cpp:1802
BOOL CreateComboBox()
Definition: appview.cpp:1753
BOOL CreateSearchBar()
Definition: appview.cpp:1741
CMainToolbar * m_Toolbar
Definition: appview.h:349
VOID AppendTabOrderWindow(int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
Definition: appview.cpp:2093
VOID SetWatermark(const CStringW &Text)
Definition: appview.cpp:2069
BOOL CreateListView()
Definition: appview.cpp:1780
CAppsListView * m_ListView
Definition: appview.h:352
VOID ItemCheckStateChanged(BOOL bChecked, LPVOID CallbackParam)
Definition: appview.cpp:2162
INT AddItem(INT ItemIndex, INT IconIndex, LPCWSTR lpText, LPARAM lParam)
Definition: appview.cpp:1247
void DeleteColumn(INT Index)
Definition: appview.cpp:1240
VOID ColumnClick(LPNMLISTVIEW pnmv)
Definition: appview.cpp:1184
INT ItemCount
Definition: appview.h:198
BOOL SetViewMode(DWORD ViewMode)
Definition: appview.cpp:1452
INT ColumnCount
Definition: appview.h:200
void ShowCheckboxes(bool bShow)
Definition: appview.cpp:1177
VOID ItemCheckStateNotify(int iItem, BOOL bCheck)
Definition: appview.cpp:1506
VOID CheckAll()
Definition: appview.cpp:1341
HIMAGELIST m_hImageListView
Definition: appview.h:206
HIMAGELIST GetImageList(int iImageList)
Definition: appview.cpp:1268
BOOL SetDisplayAppType(APPLICATION_VIEW_TYPE AppType)
Definition: appview.cpp:1370
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:204
LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: appview.cpp:1127
bool bHasCheckboxes
Definition: appview.h:196
PVOID GetFocusedItemData()
Definition: appview.cpp:1359
HWND Create(HWND hwndParent)
Definition: appview.cpp:1303
BOOL GetCheckState(INT item)
Definition: appview.cpp:1326
VOID SetWatermark(const CStringW &Text)
Definition: appview.cpp:1171
VOID SetCheckState(INT item, BOOL fCheck)
Definition: appview.cpp:1332
LRESULT OnAsyncIcon(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: appview.cpp:1145
INT nLastHeaderID
Definition: appview.h:202
BOOL AddColumn(INT Index, CStringW &Text, INT Width, INT Format)
Definition: appview.cpp:1224
CStringW m_Watermark
Definition: appview.h:207
BOOL AddApplication(CAppInfo *AppInfo, BOOL InitialCheckState)
Definition: appview.cpp:1458
INT CheckedItemCount
Definition: appview.h:199
static INT CALLBACK s_CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
Definition: appview.cpp:1274
BOOL bIsAscending
Definition: appview.h:195
INT CompareFunc(LPARAM lParam1, LPARAM lParam2, INT iSubItem)
Definition: appview.cpp:1281
const int m_DefaultSelectType
Definition: appview.h:333
HWND Create(HWND hwndParent)
Definition: appview.cpp:261
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:213
DWORD GetMaxButtonsWidth() const
Definition: appview.cpp:221
VOID OnGetDispInfo(LPTOOLTIPTEXT lpttt)
Definition: appview.cpp:109
HWND Create(HWND hwndParent)
Definition: appview.cpp:146
const INT m_iToolbarHeight
Definition: appview.h:277
void ShowButtonCaption(bool bShow)
Definition: appview.cpp:203
VOID AddImageToImageList(HIMAGELIST hImageList, UINT ImageIndex)
Definition: appview.cpp:66
HIMAGELIST InitImageList()
Definition: appview.cpp:81
BOOL m_bAppwizMode
Definition: gui.h:61
BOOL SearchTextChanged(CStringW &SearchText)
Definition: gui.cpp:824
BOOL InstallApplication(CAppInfo *Info)
Definition: gui.cpp:809
VOID ItemCheckStateChanged(BOOL bChecked, LPVOID CallbackParam)
Definition: gui.cpp:781
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:240
const INT m_Height
Definition: appview.h:309
const INT m_Width
Definition: appview.h:308
VOID SetText(LPCWSTR lpszText)
Definition: appview.cpp:234
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
struct @1641 Msg[]
char * Text
Definition: combotst.c:136
LPARAM lParam
Definition: combotst.c:139
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:928
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#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:4493
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1723
int WINAPI PathParseIconLocationW(LPWSTR lpszPath)
Definition: path.c:1092
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 BOOLEAN bSuccess
Definition: drive.cpp:355
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:849
_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 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:2492
#define _countof(array)
Definition: sndvol32.h:70
& rect
Definition: startmenu.cpp:1413
CAsyncLoadIcon * pNext
Definition: appview.cpp:1042
CAppInfo * AppInfo
Definition: appview.cpp:1044
WCHAR Location[ANYSIZE_ARRAY]
Definition: appview.cpp:1047
static void StartTasks()
Definition: appview.cpp:1103
static CAsyncLoadIcon * Queue(HWND hAppsList, CAppInfo &AppInfo, bool Parse)
Definition: appview.cpp:1081
base for all directory entries
Definition: entries.h:138
UINT mask
Definition: commctrl.h:684
int fmt
Definition: commctrl.h:689
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:3162
HWND hwndFrom
Definition: winuser.h:3160
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
#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:1737
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:1735
_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:1623
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_ERASEBKGND
Definition: winuser.h:1628
#define CS_VREDRAW
Definition: winuser.h:658
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:2028
#define COLOR_GRAYTEXT
Definition: winuser.h:935
#define DT_CENTER
Definition: winuser.h:527
#define LR_LOADFROMFILE
Definition: winuser.h:1095
#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:1611
#define EN_SETFOCUS
Definition: winuser.h:2030
#define WM_SIZE
Definition: winuser.h:1614
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define PRF_ERASEBKGND
Definition: winuser.h:2529
#define DT_SINGLELINE
Definition: winuser.h:540
#define WM_COMMAND
Definition: winuser.h:1743
#define CS_HREDRAW
Definition: winuser.h:653
#define MIIM_FTYPE
Definition: winuser.h:732
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2255
#define IDC_ARROW
Definition: winuser.h:687
#define CB_SETCURSEL
Definition: winuser.h:1964
#define WM_RBUTTONUP
Definition: winuser.h:1783
#define SW_SHOWNOACTIVATE
Definition: winuser.h:777
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define SIZE_MINIMIZED
Definition: winuser.h:2509
#define MFT_SEPARATOR
Definition: winuser.h:747
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1629
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2157
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
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:1982
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
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:1653
#define WM_TIMER
Definition: winuser.h:1745
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:2080
#define CB_ADDSTRING
Definition: winuser.h:1939
BOOL WINAPI UpdateWindow(_In_ HWND)
struct tagNMHDR * LPNMHDR
#define SendMessage
Definition: winuser.h:5855
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5731
#define EM_SETSEL
Definition: winuser.h:2021
#define CBS_HASSTRINGS
Definition: winuser.h:285
#define LR_SHARED
Definition: winuser.h:1103
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4319
#define WM_LBUTTONUP
Definition: winuser.h:1780
#define DT_VCENTER
Definition: winuser.h:543
#define LoadImage
Definition: winuser.h:5827
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
#define PRF_CHECKVISIBLE
Definition: winuser.h:2526
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:1612
#define LR_DEFAULTSIZE
Definition: winuser.h:1097
#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:1946
#define GWL_STYLE
Definition: winuser.h:855
#define SM_CXICON
Definition: winuser.h:975
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MAKEINTRESOURCE
Definition: winuser.h:591
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:931
HDWP WINAPI BeginDeferWindowPos(_In_ int)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2105
#define MF_GRAYED
Definition: winuser.h:129
#define EN_CHANGE
Definition: winuser.h:2025
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185