ReactOS 0.4.16-dev-240-gdb5fa3b
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)
 
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 1032 of file appview.cpp.

1033{
1034 delete RichEdit;
1035 delete ScrnshotPrev;
1036}
CAppRichEdit * RichEdit
Definition: appview.h:168
CAppScrnshotPreview * ScrnshotPrev
Definition: appview.h:169

Member Function Documentation

◆ Create()

HWND CAppInfoDisplay::Create ( HWND  hwndParent)

Definition at line 950 of file appview.cpp.

951{
952 RECT r = {0, 0, 0, 0};
953
955}
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 924 of file appview.cpp.

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}
#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:658
#define CS_HREDRAW
Definition: winuser.h:653
#define IDC_ARROW
Definition: winuser.h:687
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5731
#define COLOR_BTNFACE
Definition: winuser.h:931

◆ OnCommand()

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

Definition at line 1011 of file appview.cpp.

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}
VOID CopyTextToClipboard(LPCWSTR lpszText)
Definition: misc.cpp:16
#define ID_COPY_LINK
Definition: resource.h:79
#define ID_OPEN_LINK
Definition: resource.h:78
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:2492
#define SW_SHOWNOACTIVATE
Definition: winuser.h:777

Referenced by ProcessWindowMessage().

◆ OnLink()

VOID CAppInfoDisplay::OnLink ( ENLINK Link)
private

Definition at line 894 of file appview.cpp.

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}
VOID ShowPopupMenuEx(HWND hwnd, HWND hwndOwner, UINT MenuID, UINT DefaultItem, POINT *Point=NULL)
Definition: misc.cpp:68
#define IDR_LINKMENU
Definition: resource.h:69
#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:1783
#define EM_SETSEL
Definition: winuser.h:2021
#define WM_LBUTTONUP
Definition: winuser.h:1780
__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 775 of file appview.cpp.

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}
#define WM_RAPPS_RESIZE_CHILDREN
Definition: appview.h:41
BOOL GetStorageDirectory(CStringW &lpDirectory)
Definition: misc.cpp:170
VOID OnCommand(WPARAM wParam, LPARAM lParam)
Definition: appview.cpp:1011
VOID OnLink(ENLINK *Link)
Definition: appview.cpp:894
VOID ResizeChildren()
Definition: appview.cpp:837
HWND Create(HWND hParent)
Definition: appview.cpp:635
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:3162
HWND hwndFrom
Definition: winuser.h:3160
_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:1611
#define WM_SIZE
Definition: winuser.h:1614
#define WM_COMMAND
Definition: winuser.h:1743
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1629

◆ ResizeChildren() [1/2]

VOID CAppInfoDisplay::ResizeChildren ( )
private

Definition at line 837 of file appview.cpp.

838{
839 CRect rect;
841 ResizeChildren(rect.Width(), rect.Height());
842}
& 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 845 of file appview.cpp.

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}
#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:740
#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 974 of file appview.cpp.

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}
#define IDS_WELCOME_TITLE
Definition: resource.h:93
#define IDS_WELCOME_TEXT
Definition: resource.h:94
#define IDS_APPWIZ_TEXT1
Definition: resource.h:97
#define IDS_APPWIZ_TEXT2
Definition: resource.h:98
#define IDS_APPWIZ_TITLE
Definition: resource.h:96
#define IDS_WELCOME_URL
Definition: resource.h:95
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)

Definition at line 958 of file appview.cpp.

959{
960 CStringW ScrnshotLocation;
961 if (Info->RetrieveScreenshot(ScrnshotLocation))
962 {
963 ScrnshotPrev->DisplayImage(ScrnshotLocation);
964 }
965 else
966 {
968 }
970 Info->ShowAppInfo(RichEdit);
971}
BOOL DisplayImage(LPCWSTR lpszLocation)
Definition: appview.cpp:676
_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::ItemGetFocus().

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: