ReactOS 0.4.15-dev-8227-g32d615f
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 ()
 
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 154 of file appview.h.

Constructor & Destructor Documentation

◆ ~CAppInfoDisplay()

CAppInfoDisplay::~CAppInfoDisplay ( )

Definition at line 967 of file appview.cpp.

968{
969 delete RichEdit;
970 delete ScrnshotPrev;
971}
CAppRichEdit * RichEdit
Definition: appview.h:170
CAppScrnshotPreview * ScrnshotPrev
Definition: appview.h:171

Member Function Documentation

◆ Create()

HWND CAppInfoDisplay::Create ( HWND  hwndParent)

Definition at line 914 of file appview.cpp.

915{
916 RECT r = {0, 0, 0, 0};
917
919}
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 888 of file appview.cpp.

889{
890 DWORD csStyle = CS_VREDRAW | CS_HREDRAW;
891 static ATL::CWndClassInfo wc = {/*.m_wc=*/
892 {/*cbSize=*/sizeof(WNDCLASSEX),
893 /*style=*/csStyle,
894 /*lpfnWndProc=*/StartWindowProc,
895 /*cbClsExtra=*/0,
896 /*cbWndExtra=*/0,
897 /*hInstance=*/NULL,
898 /*hIcon=*/NULL,
899 /*hCursor*/ NULL,
900 /*hbrBackground=*/(HBRUSH)(COLOR_BTNFACE + 1),
901 /*lpszMenuName=*/NULL,
902 /*lpszClassName=*/L"RAppsAppInfo",
903 /*hIconSm=*/NULL},
904 /*m_lpszOrigName=*/NULL,
905 /*pWndProc=*/NULL,
906 /*m_lpszCursorID=*/IDC_ARROW,
907 /*m_bSystemCursor*/ TRUE,
908 /*m_atom=*/0,
909 /*m_szAutoName=*/_T("")};
910 return wc;
911}
#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:5728
#define COLOR_BTNFACE
Definition: winuser.h:928

◆ OnCommand()

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

Definition at line 946 of file appview.cpp.

947{
948 WORD wCommand = LOWORD(wParam);
949
950 switch (wCommand)
951 {
952 case ID_OPEN_LINK:
953
954 ShellExecuteW(m_hWnd, L"open", pLink, NULL, NULL, SW_SHOWNOACTIVATE);
956 pLink = NULL;
957 break;
958
959 case ID_COPY_LINK:
962 pLink = NULL;
963 break;
964 }
965}
VOID CopyTextToClipboard(LPCWSTR lpszText)
Definition: misc.cpp:16
#define ID_COPY_LINK
Definition: resource.h:80
#define ID_OPEN_LINK
Definition: resource.h:79
LPWSTR pLink
Definition: appview.h:156
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:2486
#define SW_SHOWNOACTIVATE
Definition: winuser.h:774

Referenced by ProcessWindowMessage().

◆ OnLink()

VOID CAppInfoDisplay::OnLink ( ENLINK Link)
private

Definition at line 858 of file appview.cpp.

859{
860 switch (Link->msg)
861 {
862 case WM_LBUTTONUP:
863 case WM_RBUTTONUP:
864 {
865 if (pLink)
867
869 GetProcessHeap(), 0,
870 (max(Link->chrg.cpMin, Link->chrg.cpMax) - min(Link->chrg.cpMin, Link->chrg.cpMax) + 1) *
871 sizeof(WCHAR));
872 if (!pLink)
873 {
874 /* TODO: Error message */
875 return;
876 }
877
878 RichEdit->SendMessageW(EM_SETSEL, Link->chrg.cpMin, Link->chrg.cpMax);
879 RichEdit->SendMessageW(EM_GETSELTEXT, 0, (LPARAM)pLink);
880
881 ShowPopupMenuEx(m_hWnd, m_hWnd, IDR_LINKMENU, -1);
882 }
883 break;
884 }
885}
VOID ShowPopupMenuEx(HWND hwnd, HWND hwndOwner, UINT MenuID, UINT DefaultItem)
Definition: misc.cpp:43
#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:1780
#define EM_SETSEL
Definition: winuser.h:2018
#define WM_LBUTTONUP
Definition: winuser.h:1777
__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 744 of file appview.cpp.

751{
752 theResult = 0;
753 switch (message)
754 {
755 case WM_CREATE:
756 {
757 RichEdit = new CAppRichEdit();
759
764 break;
765 }
766 case WM_SIZE:
767 {
769 break;
770 }
772 {
774 break;
775 }
776 case WM_COMMAND:
777 {
779 break;
780 }
781 case WM_NOTIFY:
782 {
783 NMHDR *NotifyHeader = (NMHDR *)lParam;
784 if (NotifyHeader->hwndFrom == RichEdit->m_hWnd)
785 {
786 switch (NotifyHeader->code)
787 {
788 case EN_LINK:
789 OnLink((ENLINK *)lParam);
790 break;
791 }
792 }
793 break;
794 }
795 }
796
797 return FALSE;
798}
#define WM_RAPPS_RESIZE_CHILDREN
Definition: appview.h:41
BOOL GetStorageDirectory(CStringW &lpDirectory)
Definition: misc.cpp:142
VOID OnCommand(WPARAM wParam, LPARAM lParam)
Definition: appview.cpp:946
VOID OnLink(ENLINK *Link)
Definition: appview.cpp:858
VOID ResizeChildren()
Definition: appview.cpp:801
HWND Create(HWND hParent)
Definition: appview.cpp:604
HWND Create(HWND hwndParent)
Definition: crichedit.h:104
LPARAM lParam
Definition: combotst.c:139
#define FALSE
Definition: types.h:117
#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:3159
HWND hwndFrom
Definition: winuser.h:3157
_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
#define WM_CREATE
Definition: winuser.h:1608
#define WM_SIZE
Definition: winuser.h:1611
#define WM_COMMAND
Definition: winuser.h:1740

◆ ResizeChildren() [1/2]

VOID CAppInfoDisplay::ResizeChildren ( )
private

Definition at line 801 of file appview.cpp.

802{
803 CRect rect;
805 ResizeChildren(rect.Width(), rect.Height());
806}
& 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 809 of file appview.cpp.

810{
811 int ScrnshotWidth = ScrnshotPrev->GetRequestedWidth(Height);
812
813 // make sure richedit always have room to display
814 ScrnshotWidth = min(ScrnshotWidth, Width - INFO_DISPLAY_PADDING - RICHEDIT_MIN_WIDTH);
815
816 DWORD dwError = ERROR_SUCCESS;
817 HDWP hDwp = BeginDeferWindowPos(2);
818
819 if (hDwp)
820 {
821 hDwp = ::DeferWindowPos(hDwp, ScrnshotPrev->m_hWnd, NULL, 0, 0, ScrnshotWidth, Height, 0);
822
823 if (hDwp)
824 {
825 // hide the padding if scrnshot window width == 0
826 int RicheditPosX = ScrnshotWidth ? (ScrnshotWidth + INFO_DISPLAY_PADDING) : 0;
827
828 hDwp = ::DeferWindowPos(hDwp, RichEdit->m_hWnd, NULL, RicheditPosX, 0, Width - RicheditPosX, Height, 0);
829
830 if (hDwp)
831 {
832 EndDeferWindowPos(hDwp);
833 }
834 else
835 {
836 dwError = GetLastError();
837 }
838 }
839 else
840 {
841 dwError = GetLastError();
842 }
843 }
844 else
845 {
846 dwError = GetLastError();
847 }
848
849#if DBG
850 ATLASSERT(dwError == ERROR_SUCCESS);
851#endif
852 UNREFERENCED_PARAMETER(dwError);
853
854 UpdateWindow();
855}
#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:709
#define ERROR_SUCCESS
Definition: deptool.c:10
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
_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 ( )

Definition at line 938 of file appview.cpp.

939{
943}
VOID SetWelcomeText()
Definition: appview.cpp:272

Referenced by CApplicationView::SetDisplayAppType().

◆ ShowAppInfo()

VOID CAppInfoDisplay::ShowAppInfo ( CAppInfo Info)

Definition at line 922 of file appview.cpp.

923{
924 CStringW ScrnshotLocation;
925 if (Info->RetrieveScreenshot(ScrnshotLocation))
926 {
927 ScrnshotPrev->DisplayImage(ScrnshotLocation);
928 }
929 else
930 {
932 }
934 Info->ShowAppInfo(RichEdit);
935}
BOOL DisplayImage(LPCWSTR lpszLocation)
Definition: appview.cpp:645
_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 156 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: