ReactOS 0.4.15-dev-7906-g1b85a5f
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 964 of file appview.cpp.

965{
966 delete RichEdit;
967 delete ScrnshotPrev;
968}
CAppRichEdit * RichEdit
Definition: appview.h:170
CAppScrnshotPreview * ScrnshotPrev
Definition: appview.h:171

Member Function Documentation

◆ Create()

HWND CAppInfoDisplay::Create ( HWND  hwndParent)

Definition at line 911 of file appview.cpp.

912{
913 RECT r = {0, 0, 0, 0};
914
916}
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 885 of file appview.cpp.

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

◆ OnCommand()

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

Definition at line 943 of file appview.cpp.

944{
945 WORD wCommand = LOWORD(wParam);
946
947 switch (wCommand)
948 {
949 case ID_OPEN_LINK:
950
951 ShellExecuteW(m_hWnd, L"open", pLink, NULL, NULL, SW_SHOWNOACTIVATE);
953 pLink = NULL;
954 break;
955
956 case ID_COPY_LINK:
959 pLink = NULL;
960 break;
961 }
962}
VOID CopyTextToClipboard(LPCWSTR lpszText)
Definition: misc.cpp:19
#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:2402
#define SW_SHOWNOACTIVATE
Definition: winuser.h:774

Referenced by ProcessWindowMessage().

◆ OnLink()

VOID CAppInfoDisplay::OnLink ( ENLINK Link)
private

Definition at line 855 of file appview.cpp.

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

748{
749 theResult = 0;
750 switch (message)
751 {
752 case WM_CREATE:
753 {
754 RichEdit = new CAppRichEdit();
756
761 break;
762 }
763 case WM_SIZE:
764 {
766 break;
767 }
769 {
771 break;
772 }
773 case WM_COMMAND:
774 {
776 break;
777 }
778 case WM_NOTIFY:
779 {
780 NMHDR *NotifyHeader = (NMHDR *)lParam;
781 if (NotifyHeader->hwndFrom == RichEdit->m_hWnd)
782 {
783 switch (NotifyHeader->code)
784 {
785 case EN_LINK:
786 OnLink((ENLINK *)lParam);
787 break;
788 }
789 }
790 break;
791 }
792 }
793
794 return FALSE;
795}
#define WM_RAPPS_RESIZE_CHILDREN
Definition: appview.h:42
BOOL GetStorageDirectory(CStringW &lpDirectory)
Definition: misc.cpp:145
VOID OnCommand(WPARAM wParam, LPARAM lParam)
Definition: appview.cpp:943
VOID OnLink(ENLINK *Link)
Definition: appview.cpp:855
VOID ResizeChildren()
Definition: appview.cpp:798
HWND Create(HWND hParent)
Definition: appview.cpp:601
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 798 of file appview.cpp.

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

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

936{
940}
VOID SetWelcomeText()
Definition: appview.cpp:269

Referenced by CApplicationView::SetDisplayAppType().

◆ ShowAppInfo()

VOID CAppInfoDisplay::ShowAppInfo ( CAppInfo Info)

Definition at line 919 of file appview.cpp.

920{
921 CStringW ScrnshotLocation;
922 if (Info->RetrieveScreenshot(ScrnshotLocation))
923 {
924 ScrnshotPrev->DisplayImage(ScrnshotLocation);
925 }
926 else
927 {
929 }
931 Info->ShowAppInfo(RichEdit);
932}
BOOL DisplayImage(LPCWSTR lpszLocation)
Definition: appview.cpp:642
_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: