ReactOS 0.4.16-dev-1097-g530d26a
CAppInfoDisplay Class Reference

#include <appview.h>

Inheritance diagram for CAppInfoDisplay:
Collaboration diagram for CAppInfoDisplay:

Public Member Functions

HWND Create (HWND hwndParent)
 
VOID ShowAppInfo (CAppInfo &Info, bool OnlyUpdateText=false)
 
void SetWelcomeText (bool bAppwiz)
 
VOID OnCommand (WPARAM wParam, LPARAM lParam)
 
 ~CAppInfoDisplay ()
 
- Public Member Functions inherited from CUiWindow< CWindowImpl< CAppInfoDisplay > >
virtual CUiBoxAsBox ()
 
HWND GetWindow ()
 
virtual VOID ComputeMinimalSize (SIZE *size)
 
virtual VOID ComputeContentBounds (RECT *rect)
 
virtual DWORD_PTR CountSizableChildren ()
 
virtual HDWP OnParentSize (RECT parentRect, HDWP hDwp)
 
virtual VOID AppendTabOrderWindow (int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
 
virtual ~CUiWindow ()
 
VOID GetWindowTextW (CStringW &szText)
 
- Public Member Functions inherited from CUiPrimitive
virtual ~CUiPrimitive ()
 
virtual CUiBoxAsBox ()
 
virtual VOID ComputeMinimalSize (SIZE *size)
 
virtual VOID ComputeContentBounds (RECT *rect)
 
virtual DWORD_PTR CountSizableChildren ()
 
virtual HDWP OnParentSize (RECT parentRect, HDWP hDwp)
 

Static Public Member Functions

static ATL::CWndClassInfoGetWndClassInfo ()
 

Public Attributes

CAppRichEditRichEdit = NULL
 
CAppScrnshotPreviewScrnshotPrev = NULL
 
- Public Attributes inherited from CUiBox
CUiMargin m_Margin
 
CUiAlignment m_HorizontalAlignment
 
CUiAlignment m_VerticalAlignment
 

Private Member Functions

BOOL ProcessWindowMessage (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId)
 
VOID OnLink (ENLINK *Link)
 
VOID ResizeChildren ()
 
VOID ResizeChildren (int Width, int Height)
 

Private Attributes

LPWSTR pLink = NULL
 

Additional Inherited Members

- Protected Member Functions inherited from CUiBox
 CUiBox ()
 
virtual VOID ComputeRect (RECT parentRect, RECT currentRect, RECT *newRect)
 
- Protected Attributes inherited from CUiPrimitive
CUiPrimitivem_Parent
 

Detailed Description

Definition at line 152 of file appview.h.

Constructor & Destructor Documentation

◆ ~CAppInfoDisplay()

CAppInfoDisplay::~CAppInfoDisplay ( )

Definition at line 1036 of file appview.cpp.

1037{
1038 delete RichEdit;
1039 delete ScrnshotPrev;
1040}
CAppRichEdit * RichEdit
Definition: appview.h:168
CAppScrnshotPreview * ScrnshotPrev
Definition: appview.h:169

Member Function Documentation

◆ Create()

HWND CAppInfoDisplay::Create ( HWND  hwndParent)

Definition at line 951 of file appview.cpp.

952{
953 RECT r = {0, 0, 0, 0};
954
956}
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
static HWND hwndParent
Definition: cryptui.c:300
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define L(x)
Definition: ntvdm.h:50
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619

Referenced by CApplicationView::CreateAppInfoDisplay().

◆ GetWndClassInfo()

ATL::CWndClassInfo & CAppInfoDisplay::GetWndClassInfo ( )
static

Definition at line 925 of file appview.cpp.

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}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
unsigned long DWORD
Definition: ntddk_ex.h:95
#define _T(x)
Definition: vfdio.h:22
#define CS_VREDRAW
Definition: winuser.h:666
#define CS_HREDRAW
Definition: winuser.h:661
#define IDC_ARROW
Definition: winuser.h:695
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5739
#define COLOR_BTNFACE
Definition: winuser.h:939

◆ OnCommand()

VOID CAppInfoDisplay::OnCommand ( WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1015 of file appview.cpp.

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}
VOID CopyTextToClipboard(LPCWSTR lpszText)
Definition: misc.cpp:28
#define ID_COPY_LINK
Definition: resource.h:80
#define ID_OPEN_LINK
Definition: resource.h:79
LPWSTR pLink
Definition: appview.h:154
WPARAM wParam
Definition: combotst.c:138
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
unsigned short WORD
Definition: ntddk_ex.h:93
#define LOWORD(l)
Definition: pedump.c:82
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2529
#define SW_SHOWNOACTIVATE
Definition: winuser.h:785

Referenced by ProcessWindowMessage().

◆ OnLink()

VOID CAppInfoDisplay::OnLink ( ENLINK Link)
private

Definition at line 895 of file appview.cpp.

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}
VOID ShowPopupMenuEx(HWND hwnd, HWND hwndOwner, UINT MenuID, UINT DefaultItem, POINT *Point=NULL)
Definition: misc.cpp:80
#define IDR_LINKMENU
Definition: resource.h:70
#define HeapAlloc
Definition: compat.h:733
#define min(a, b)
Definition: monoChain.cc:55
#define EM_GETSELTEXT
Definition: richedit.h:95
#define max(a, b)
Definition: svc.c:63
static int Link(const char **args)
Definition: vfdcmd.c:2414
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_RBUTTONUP
Definition: winuser.h:1791
#define EM_SETSEL
Definition: winuser.h:2029
#define WM_LBUTTONUP
Definition: winuser.h:1788
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by ProcessWindowMessage().

◆ ProcessWindowMessage()

BOOL CAppInfoDisplay::ProcessWindowMessage ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam,
LRESULT theResult,
DWORD  dwMapId 
)
private

Definition at line 776 of file appview.cpp.

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}
#define WM_RAPPS_RESIZE_CHILDREN
Definition: appview.h:41
BOOL GetStorageDirectory(CStringW &lpDirectory)
Definition: misc.cpp:237
VOID OnCommand(WPARAM wParam, LPARAM lParam)
Definition: appview.cpp:1015
VOID OnLink(ENLINK *Link)
Definition: appview.cpp:895
VOID ResizeChildren()
Definition: appview.cpp:838
HWND Create(HWND hParent)
Definition: appview.cpp:636
HWND Create(HWND hwndParent)
Definition: crichedit.h:104
LPARAM lParam
Definition: combotst.c:139
#define FALSE
Definition: types.h:117
#define EM_SETBKGNDCOLOR
Definition: richedit.h:100
#define EN_LINK
Definition: richedit.h:202
#define WM_NOTIFY
Definition: richedit.h:61
base for all directory entries
Definition: entries.h:138
Definition: tftpd.h:60
UINT code
Definition: winuser.h:3170
HWND hwndFrom
Definition: winuser.h:3168
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
DWORD WINAPI GetSysColor(_In_ int)
#define WM_CREATE
Definition: winuser.h:1619
#define WM_SIZE
Definition: winuser.h:1622
#define WM_COMMAND
Definition: winuser.h:1751
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1637

◆ ResizeChildren() [1/2]

VOID CAppInfoDisplay::ResizeChildren ( )
private

Definition at line 838 of file appview.cpp.

839{
840 CRect rect;
842 ResizeChildren(rect.Width(), rect.Height());
843}
& rect
Definition: startmenu.cpp:1413
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

Referenced by ProcessWindowMessage(), ResizeChildren(), SetWelcomeText(), and ShowAppInfo().

◆ ResizeChildren() [2/2]

VOID CAppInfoDisplay::ResizeChildren ( int  Width,
int  Height 
)
private

Definition at line 846 of file appview.cpp.

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}
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
#define RICHEDIT_MIN_WIDTH
Definition: appview.h:33
#define INFO_DISPLAY_PADDING
Definition: appview.h:30
HWND m_hWnd
Definition: atlwin.h:273
int GetRequestedWidth(int Height)
Definition: appview.cpp:741
#define ERROR_SUCCESS
Definition: deptool.c:10
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
BOOL WINAPI UpdateWindow(_In_ HWND)
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
HDWP WINAPI BeginDeferWindowPos(_In_ int)

◆ SetWelcomeText()

void CAppInfoDisplay::SetWelcomeText ( bool  bAppwiz)

Definition at line 978 of file appview.cpp.

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}
#define IDS_WELCOME_TITLE
Definition: resource.h:94
#define IDS_WELCOME_TEXT
Definition: resource.h:95
#define IDS_APPWIZ_TEXT1
Definition: resource.h:98
#define IDS_APPWIZ_TEXT2
Definition: resource.h:99
#define IDS_APPWIZ_TITLE
Definition: resource.h:97
#define IDS_WELCOME_URL
Definition: resource.h:96
VOID InsertText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:77
VOID SetText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:91
#define CFE_BOLD
Definition: richedit.h:406
#define CFM_LINK
Definition: richedit.h:337

Referenced by CApplicationView::SetDisplayAppType().

◆ ShowAppInfo()

VOID CAppInfoDisplay::ShowAppInfo ( CAppInfo Info,
bool  OnlyUpdateText = false 
)

Definition at line 959 of file appview.cpp.

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}
BOOL DisplayImage(LPCWSTR lpszLocation)
Definition: appview.cpp:677
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690

Referenced by CApplicationView::RefreshDetailsPane().

Member Data Documentation

◆ pLink

LPWSTR CAppInfoDisplay::pLink = NULL
private

Definition at line 154 of file appview.h.

Referenced by OnCommand(), and OnLink().

◆ RichEdit

CAppRichEdit* CAppInfoDisplay::RichEdit = NULL

◆ ScrnshotPrev

CAppScrnshotPreview* CAppInfoDisplay::ScrnshotPrev = NULL

The documentation for this class was generated from the following files: