ReactOS 0.4.17-dev-940-g8bd6e85
CConsoleWnd Class Reference

#include <CConsoleWnd.h>

Inheritance diagram for CConsoleWnd:
Collaboration diagram for CConsoleWnd:

Public Member Functions

 CConsoleWnd (CMainWnd *MainWnd, CSnapin *RootNode)
 
 ~CConsoleWnd ()
 
LRESULT OnCreate (UINT nMessage, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnDestroy (UINT nMessage, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSize (UINT nMessage, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnDrawItem (UINT nMessage, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
BOOL IsTreeViewVisible ()
 
VOID SetTreeViewVisible (BOOL bVisible)
 
BOOL IsStatusBarVisible ()
 
VOID SetStatusBarVisible (BOOL bVisible)
 
BOOL IsDescriptionBarVisible ()
 
VOID SetDescriptionBarVisible (BOOL bVisible)
 
BOOL IsActionsPaneVisible ()
 
VOID SetActionsPaneVisible (BOOL bVisible)
 
VOID UpdateView ()
 
VOID SaveView (MscFile *mscFile, IXMLDOMElement *pParentElement)
 
STDMETHODIMP QueryInterface (REFIID riid, void **ppvObject)
 
 STDMETHODIMP_ (ULONG) AddRef()
 
 STDMETHODIMP_ (ULONG) Release()
 
STDMETHODIMP SetHeader (LPHEADERCTRL pHeader)
 
STDMETHODIMP SetToolbar (LPTOOLBAR pToolbar)
 
STDMETHODIMP QueryResultView (LPUNKNOWN *pUnknown)
 
STDMETHODIMP QueryScopeImageList (LPIMAGELIST *ppImageList)
 
STDMETHODIMP QueryResultImageList (LPIMAGELIST *ppImageList)
 
STDMETHODIMP UpdateAllViews (LPDATAOBJECT lpDataObject, LPARAM data, LONG_PTR hint)
 
STDMETHODIMP MessageBox (LPCWSTR lpszText, LPCWSTR lpszTitle, UINT fuStyle, int *piRetval)
 
STDMETHODIMP QueryConsoleVerb (LPCONSOLEVERB *ppConsoleVerb)
 
STDMETHODIMP SelectScopeItem (HSCOPEITEM hScopeItem)
 
STDMETHODIMP GetMainWindow (HWND *phwnd)
 
STDMETHODIMP NewWindow (HSCOPEITEM hScopeItem, ULONG lOptions)
 
STDMETHODIMP Expand (HSCOPEITEM hItem, BOOL bExpand)
 
STDMETHODIMP IsTaskpadViewPreferred ()
 
STDMETHODIMP SetStatusText (LPOLESTR pszStatusText)
 
STDMETHODIMP InsertItem (LPSCOPEDATAITEM item)
 
STDMETHODIMP DeleteItem (HSCOPEITEM hItem, LONG fDeleteThis)
 
STDMETHODIMP SetItem (LPSCOPEDATAITEM item)
 
STDMETHODIMP GetItem (LPSCOPEDATAITEM item)
 
STDMETHODIMP GetChildItem (HSCOPEITEM item, HSCOPEITEM *pItemChild, LONG *plCookie)
 
STDMETHODIMP GetNextItem (HSCOPEITEM item, HSCOPEITEM *pItemNext, LONG *plCookie)
 
STDMETHODIMP GetParentItem (HSCOPEITEM item, HSCOPEITEM *pItemParent, LONG *plCookie)
 
STDMETHODIMP Expand (HSCOPEITEM hItem)
 
STDMETHODIMP AddExtension (HSCOPEITEM hItem, LPCLSID lpClsid)
 
HRESULT Expand ([in] HSCOPEITEM hItem, [in] BOOL bExpand)
 
HRESULT IsTaskpadViewPreferred ()
 
HRESULT SetStatusText ([in] LPOLESTR pszStatusText)
 
- Public Member Functions inherited from IConsole
HRESULT SetHeader ([in] LPHEADERCTRL pHeader)
 
HRESULT SetToolbar ([in] LPTOOLBAR pToolbar)
 
HRESULT QueryResultView ([out] LPUNKNOWN *pUnknown)
 
HRESULT QueryScopeImageList ([out] LPIMAGELIST *ppImageList)
 
HRESULT QueryResultImageList ([out] LPIMAGELIST *ppImageList)
 
HRESULT UpdateAllViews ([in] LPDATAOBJECT lpDataObject, [in] LPARAM data, [in] LONG_PTR hint)
 
HRESULT MessageBox ([in] LPCWSTR lpszText, [in] LPCWSTR lpszTitle, [in] UINT fuStyle, [out] int *piRetval)
 
HRESULT QueryConsoleVerb ([out] LPCONSOLEVERB *ppConsoleVerb)
 
HRESULT SelectScopeItem ([in] HSCOPEITEM hScopeItem)
 
HRESULT GetMainWindow ([out] HWND *phwnd)
 
HRESULT NewWindow ([in] HSCOPEITEM hScopeItem, [in] unsigned long lOptions)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
HRESULT Expand ([in] HSCOPEITEM hItem)
 
HRESULT AddExtension ([in] HSCOPEITEM hItem, [in] LPCLSID lpClsid)
 
HRESULT InsertItem ([in, out] LPSCOPEDATAITEM item)
 
HRESULT DeleteItem ([in] HSCOPEITEM hItem, [in] long fDeleteThis)
 
HRESULT SetItem ([in] LPSCOPEDATAITEM item)
 
HRESULT GetItem ([in, out] LPSCOPEDATAITEM item)
 
HRESULT GetChildItem ([in] HSCOPEITEM item, [out] HSCOPEITEM *pItemChild, [out] long *plCookie)
 
HRESULT GetNextItem ([in] HSCOPEITEM item, [out] HSCOPEITEM *pItemNext, [out] long *plCookie)
 
HRESULT GetParentItem ([in] HSCOPEITEM item, [out] HSCOPEITEM *pItemParent, [out] long *plCookie)
 

Static Public Member Functions

static CWndClassInfo & GetWndClassInfo ()
 
static LPCWSTR GetWndClassName ()
 

Private Member Functions

VOID UpdateLayout ()
 
VOID AddTreeViewItemRecursive (HTREEITEM hParentTreeItem, CSnapin *Node)
 
VOID UpdateTreeView ()
 

Private Attributes

int m_ViewId
 
CMainWnd * m_MainWnd
 
CTreeView m_TreeView
 
CListView m_ListView
 
CStatusBar m_StatusBar
 
CWindow m_DescriptionBar
 
int m_iTreeViewWidth
 
int m_iActionsPaneWidth
 
int m_iSplitterWidth
 
int m_iSplitOffset
 
int m_iSplitSide
 
int m_iStatusBarHeight
 
BOOL m_bTreeViewVisible
 
BOOL m_bActionsPaneVisible
 
BOOL m_bStatusBarVisible
 
BOOL m_bDescriptionBarVisible
 
CSnapin * m_ViewRootNode
 
CSnapin * m_ViewSelectedNode
 

Additional Inherited Members

- Public Types inherited from IUnknown
typedef IUnknown * LPUNKNOWN
 

Detailed Description

Definition at line 14 of file CConsoleWnd.h.

Constructor & Destructor Documentation

◆ CConsoleWnd()

CConsoleWnd::CConsoleWnd ( CMainWnd *  MainWnd,
CSnapin *  RootNode 
)

Definition at line 12 of file CConsoleWnd.cpp.

13 {
14 m_MainWnd = MainWnd;
17 m_pfnSuperWindowProc = DefMDIChildProc;
18
19 if (!m_thunk.Init(NULL, NULL))
20 return;
21 _AtlWinModule.AddCreateWndData(&m_thunk.cd, this);
22 }
CSnapin * m_ViewRootNode
Definition: CConsoleWnd.h:37
CMainWnd * m_MainWnd
Definition: CConsoleWnd.h:21
CSnapin * m_ViewSelectedNode
Definition: CConsoleWnd.h:38
#define NULL
Definition: types.h:112
PCONFIGURATION_COMPONENT_DATA RootNode
Definition: macharm.c:19
#define DefMDIChildProc
Definition: ros2win.h:33

◆ ~CConsoleWnd()

CConsoleWnd::~CConsoleWnd ( )

Definition at line 24 of file CConsoleWnd.cpp.

25 {
26 }

Member Function Documentation

◆ AddExtension()

STDMETHODIMP CConsoleWnd::AddExtension ( HSCOPEITEM  hItem,
LPCLSID  lpClsid 
)

Implements IConsoleNameSpace2.

Definition at line 509 of file CConsoleWnd.cpp.

510 {
511 DPRINT("%s()\n", __FUNCTION__);
512 __debugbreak();
513 return E_NOTIMPL;
514 }
#define E_NOTIMPL
Definition: ddrawi.h:99
#define __FUNCTION__
Definition: types.h:116
void __cdecl __debugbreak(void)
Definition: intrin_ppc.h:698
#define DPRINT
Definition: sndvol32.h:73

◆ AddTreeViewItemRecursive()

VOID CConsoleWnd::AddTreeViewItemRecursive ( HTREEITEM  hParentTreeItem,
CSnapin *  Node 
)
private

Definition at line 109 of file CConsoleWnd.cpp.

110 {
111 HTREEITEM hTreeItem;
112
113 hTreeItem = m_TreeView.AddItem(hParentTreeItem,
114 (LPWSTR)Node->DisplayName().GetString(),
115 Node->CacheEntry()->NormalImageIndex(),
116 Node->CacheEntry()->OpenImageIndex(),
117 (LPARAM)Node);
118 if (hTreeItem)
119 {
120 POSITION pos = Node->m_SubNodes.GetHeadPosition();
121 while (pos)
122 {
123 CSnapin *ChildNode = (CSnapin*)Node->m_SubNodes.GetNext(pos);
124 if (ChildNode)
125 AddTreeViewItemRecursive(hTreeItem, ChildNode);
126 }
127
128 m_TreeView.Expand(hTreeItem, TVE_EXPAND);
129
131 m_TreeView.SelectItem(hTreeItem);
132 }
133 }
VOID AddTreeViewItemRecursive(HTREEITEM hParentTreeItem, CSnapin *Node)
CTreeView m_TreeView
Definition: CConsoleWnd.h:22
BOOL Expand(HTREEITEM item, DWORD action)
Definition: rosctrls.h:604
BOOL SelectItem(HTREEITEM item, DWORD action=TVGN_CARET)
Definition: rosctrls.h:609
HTREEITEM AddItem(HTREEITEM hParent, LPWSTR lpText, INT Image, INT SelectedImage, LPARAM lParam)
Definition: rosctrls.h:503
LONG_PTR LPARAM
Definition: minwindef.h:175
#define TVE_EXPAND
Definition: commctrl.h:3428
uint16_t * LPWSTR
Definition: typedefs.h:56
Definition: dlist.c:348

Referenced by AddTreeViewItemRecursive(), and UpdateTreeView().

◆ DeleteItem()

STDMETHODIMP CConsoleWnd::DeleteItem ( HSCOPEITEM  hItem,
LONG  fDeleteThis 
)

Implements IConsoleNameSpace.

Definition at line 456 of file CConsoleWnd.cpp.

457 {
458 DPRINT("%s()\n", __FUNCTION__);
459 __debugbreak();
460 return E_NOTIMPL;
461 }

◆ Expand() [1/2]

STDMETHODIMP CConsoleWnd::Expand ( HSCOPEITEM  hItem)

Implements IConsoleNameSpace2.

Definition at line 502 of file CConsoleWnd.cpp.

503 {
504 DPRINT("%s()\n", __FUNCTION__);
505 __debugbreak();
506 return E_NOTIMPL;
507 }

◆ Expand() [2/2]

STDMETHODIMP CConsoleWnd::Expand ( HSCOPEITEM  hItem,
BOOL  bExpand 
)

Implements IConsole2.

Definition at line 425 of file CConsoleWnd.cpp.

426 {
427 DPRINT("%s()\n", __FUNCTION__);
428 __debugbreak();
429 return E_NOTIMPL;
430 }

◆ GetChildItem()

STDMETHODIMP CConsoleWnd::GetChildItem ( HSCOPEITEM  item,
HSCOPEITEM *  pItemChild,
LONG *  plCookie 
)

Implements IConsoleNameSpace.

Definition at line 477 of file CConsoleWnd.cpp.

478 {
479 DPRINT("%s()\n", __FUNCTION__);
480 __debugbreak();
481 return E_NOTIMPL;
482 }

◆ GetItem()

STDMETHODIMP CConsoleWnd::GetItem ( LPSCOPEDATAITEM  item)

Implements IConsoleNameSpace.

Definition at line 470 of file CConsoleWnd.cpp.

471 {
472 DPRINT("%s()\n", __FUNCTION__);
473 __debugbreak();
474 return E_NOTIMPL;
475 }

◆ GetMainWindow()

STDMETHODIMP CConsoleWnd::GetMainWindow ( HWND *  phwnd)

Implements IConsole.

Definition at line 409 of file CConsoleWnd.cpp.

410 {
411 DPRINT("%s()\n", __FUNCTION__);
412 __debugbreak();
413 return E_NOTIMPL;
414 }

◆ GetNextItem()

STDMETHODIMP CConsoleWnd::GetNextItem ( HSCOPEITEM  item,
HSCOPEITEM *  pItemNext,
LONG *  plCookie 
)

Implements IConsoleNameSpace.

Definition at line 484 of file CConsoleWnd.cpp.

485 {
486 DPRINT("%s()\n", __FUNCTION__);
487 __debugbreak();
488 return E_NOTIMPL;
489 }

◆ GetParentItem()

STDMETHODIMP CConsoleWnd::GetParentItem ( HSCOPEITEM  item,
HSCOPEITEM *  pItemParent,
LONG *  plCookie 
)

Implements IConsoleNameSpace.

Definition at line 491 of file CConsoleWnd.cpp.

492 {
493 DPRINT("%s()\n", __FUNCTION__);
494 __debugbreak();
495 return E_NOTIMPL;
496 }

◆ GetWndClassInfo()

static CWndClassInfo & CConsoleWnd::GetWndClassInfo ( )
inlinestatic

Definition at line 49 of file CConsoleWnd.h.

50 {
51 static CWndClassInfo wc =
52 {
53 {
54 /* cbSize= */sizeof(WNDCLASSEX),
55 /* style= */CS_HREDRAW | CS_VREDRAW,
56 /* lpfnWndProc= */StartWindowProc,
57 /* cbClsExtra= */0,
58 /* cbWndExtra= */sizeof(CConsoleWnd*),
59 /* hInstance= */NULL,
60 /* hIcon= */LoadIcon(_AtlBaseModule.GetModuleInstance(), MAKEINTRESOURCE(IDI_MAINAPP)),
61 /* hCursor= */NULL,
62 /* hbrBackground= */(HBRUSH)(COLOR_3DFACE + 1),
63 /* lpszMenuName= */NULL,
64 /* lpszClassName= */L"MMCChildFrm",
65 /* hIconSm= */LoadIcon(_AtlBaseModule.GetModuleInstance(), MAKEINTRESOURCE(IDI_MAINAPP))
66 },
67 NULL, NULL, IDC_SIZEWE, TRUE, 0, L""
68 };
69 return wc;
70 }
#define IDI_MAINAPP
Definition: resource.h:6
#define TRUE
Definition: types.h:120
#define L(x)
Definition: resources.c:13
_ATL_WNDCLASSINFOW CWndClassInfo
Definition: atlwin.h:70
#define MAKEINTRESOURCE(i)
Definition: ntverrsrc.c:25
#define CS_VREDRAW
Definition: winuser.h:666
#define CS_HREDRAW
Definition: winuser.h:661
#define LoadIcon
Definition: winuser.h:5979
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5885
#define IDC_SIZEWE
Definition: winuser.h:702
#define COLOR_3DFACE
Definition: winuser.h:940

Referenced by GetWndClassName(), and CMMCModule::PreMessageLoop().

◆ GetWndClassName()

static LPCWSTR CConsoleWnd::GetWndClassName ( )
inlinestatic

Definition at line 72 of file CConsoleWnd.h.

73 {
74 return GetWndClassInfo().m_wc.lpszClassName;
75 }
static CWndClassInfo & GetWndClassInfo()
Definition: CConsoleWnd.h:49

Referenced by CMainWnd::OnFileNew(), and CMainWnd::OnWindowsNew().

◆ InsertItem()

STDMETHODIMP CConsoleWnd::InsertItem ( LPSCOPEDATAITEM  item)

Implements IConsoleNameSpace.

Definition at line 449 of file CConsoleWnd.cpp.

450 {
451 DPRINT("%s()\n", __FUNCTION__);
452 __debugbreak();
453 return E_NOTIMPL;
454 }

◆ IsActionsPaneVisible()

BOOL CConsoleWnd::IsActionsPaneVisible ( )

Definition at line 174 of file CConsoleWnd.cpp.

175 {
177 }
BOOL m_bActionsPaneVisible
Definition: CConsoleWnd.h:33

Referenced by SaveView().

◆ IsDescriptionBarVisible()

BOOL CConsoleWnd::IsDescriptionBarVisible ( )

Definition at line 163 of file CConsoleWnd.cpp.

164 {
166 }
BOOL m_bDescriptionBarVisible
Definition: CConsoleWnd.h:35

Referenced by SaveView().

◆ IsStatusBarVisible()

BOOL CConsoleWnd::IsStatusBarVisible ( )

Definition at line 152 of file CConsoleWnd.cpp.

153 {
154 return m_bStatusBarVisible;
155 }
BOOL m_bStatusBarVisible
Definition: CConsoleWnd.h:34

Referenced by SaveView().

◆ IsTaskpadViewPreferred()

STDMETHODIMP CConsoleWnd::IsTaskpadViewPreferred ( )

Implements IConsole2.

Definition at line 432 of file CConsoleWnd.cpp.

433 {
434 DPRINT("%s()\n", __FUNCTION__);
435 __debugbreak();
436 return E_NOTIMPL;
437 }

◆ IsTreeViewVisible()

BOOL CConsoleWnd::IsTreeViewVisible ( )

Definition at line 141 of file CConsoleWnd.cpp.

142 {
143 return m_bTreeViewVisible;
144 }
BOOL m_bTreeViewVisible
Definition: CConsoleWnd.h:32

Referenced by SaveView().

◆ MessageBox()

STDMETHODIMP CConsoleWnd::MessageBox ( LPCWSTR  lpszText,
LPCWSTR  lpszTitle,
UINT  fuStyle,
int *  piRetval 
)

Implements IConsole.

Definition at line 388 of file CConsoleWnd.cpp.

389 {
390 DPRINT("%s()\n", __FUNCTION__);
391 __debugbreak();
392 return E_NOTIMPL;
393 }

◆ NewWindow()

STDMETHODIMP CConsoleWnd::NewWindow ( HSCOPEITEM  hScopeItem,
ULONG  lOptions 
)

Definition at line 416 of file CConsoleWnd.cpp.

417 {
418 DPRINT("%s()\n", __FUNCTION__);
419 __debugbreak();
420 return E_NOTIMPL;
421 }

◆ OnCreate()

LRESULT CConsoleWnd::OnCreate ( UINT  nMessage,
WPARAM  wParam,
LPARAM  lParam,
BOOL &  bHandled 
)

Definition at line 28 of file CConsoleWnd.cpp.

29 {
30 SetWindowLongPtr(0, (LONG_PTR)this);
31
36
38 m_iSplitSide = 0;
39
40 RECT Rect;
42 m_iTreeViewWidth = (Rect.right - Rect.left) / 4;
43 m_iActionsPaneWidth = (Rect.right - Rect.left) / 4;
44
45 m_StatusBar.Create(this->m_hWnd, NULL);
46 m_StatusBar.GetClientRect(&Rect);
47 m_iStatusBarHeight = Rect.bottom - Rect.top;
48
49 Rect.right = 0;
50 Rect.left = 0;
51 Rect.top = 0;
52 Rect.bottom = 0;
53 m_DescriptionBar.Create(L"Static", this->m_hWnd, &Rect, L"Description",
57
58 m_TreeView.Create(this->m_hWnd,
60
62
64
66
68
69 LPMDICREATESTRUCT mdicreate = reinterpret_cast<LPMDICREATESTRUCT>(reinterpret_cast<LPCREATESTRUCT>(lParam)->lpCreateParams);
70 if (mdicreate->lParam)
72
73 return 0;
74 }
HWND Create(LPCTSTR lpstrWndClass, 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:417
BOOL SetWindowText(LPCTSTR lpszString)
Definition: atlwin.h:1300
int m_iActionsPaneWidth
Definition: CConsoleWnd.h:27
int m_iSplitterWidth
Definition: CConsoleWnd.h:28
int m_iSplitSide
Definition: CConsoleWnd.h:30
CListView m_ListView
Definition: CConsoleWnd.h:23
int m_iTreeViewWidth
Definition: CConsoleWnd.h:26
CWindow m_DescriptionBar
Definition: CConsoleWnd.h:25
VOID UpdateTreeView()
CStatusBar m_StatusBar
Definition: CConsoleWnd.h:24
int m_iStatusBarHeight
Definition: CConsoleWnd.h:31
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
int RegisterView(CConsoleWnd *pView)
Definition: CMainWnd.cpp:562
HIMAGELIST SnapinImageList()
Definition: CMainWnd.cpp:550
HWND Create(HWND hwndParent, HMENU hMenu)
Definition: rosctrls.h:462
HIMAGELIST SetImageList(HIMAGELIST himl, int iImageList)
Definition: rosctrls.h:535
HWND Create(HWND hwndParent, DWORD dwStyles=0)
Definition: rosctrls.h:483
LPARAM lParam
Definition: combotst.c:139
#define FALSE
Definition: types.h:117
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define TVSIL_NORMAL
Definition: commctrl.h:3448
#define TVS_SHOWSELALWAYS
Definition: commctrl.h:3257
#define TVS_HASLINES
Definition: commctrl.h:3253
#define TVS_EDITLABELS
Definition: commctrl.h:3255
#define WS_EX_STATICEDGE
Definition: winuser.h:403
#define WM_SYSCOMMAND
Definition: winuser.h:1769
#define SS_OWNERDRAW
Definition: winuser.h:352
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define PostMessage
Definition: winuser.h:5998
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define SC_MAXIMIZE
Definition: winuser.h:2624
Definition: dcommon.idl:28
#define SetWindowLongPtr
Definition: treelist.c:70

◆ OnDestroy()

LRESULT CConsoleWnd::OnDestroy ( UINT  nMessage,
WPARAM  wParam,
LPARAM  lParam,
BOOL &  bHandled 
)

Definition at line 76 of file CConsoleWnd.cpp.

77 {
79 m_MainWnd->PostMessage(WM_USER_CLOSE_CHILD, 0, 0);
80 return 0;
81 }
#define WM_USER_CLOSE_CHILD
Definition: precomp.h:14
void UnregisterView(CConsoleWnd *pView)
Definition: CMainWnd.cpp:569

◆ OnDrawItem()

LRESULT CConsoleWnd::OnDrawItem ( UINT  nMessage,
WPARAM  wParam,
LPARAM  lParam,
BOOL &  bHandled 
)

Definition at line 89 of file CConsoleWnd.cpp.

90 {
92 WCHAR WindowText[256];
93
94 HBRUSH hBrush = GetSysColorBrush(COLOR_3DDKSHADOW);
95 FillRect(lpDrawItem->hDC, &lpDrawItem->rcItem, hBrush);
96
98
99 ::GetWindowTextW(lpDrawItem->hwndItem, WindowText, ARRAYSIZE(WindowText));
100 ::SetBkMode(lpDrawItem->hDC, TRANSPARENT);
101
102 lpDrawItem->rcItem.left += 4;
103 DrawTextW(lpDrawItem->hDC, (LPCWSTR)WindowText, -1, &lpDrawItem->rcItem,
105
106 return TRUE;
107 }
#define ARRAYSIZE(a)
Definition: cat.c:25
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
short WCHAR
Definition: pedump.c:58
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
DWORD WINAPI GetSysColor(_In_ int)
#define DT_NOPREFIX
Definition: winuser.h:537
#define DT_END_ELLIPSIS
Definition: winuser.h:529
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define DT_SINGLELINE
Definition: winuser.h:540
#define COLOR_3DDKSHADOW
Definition: winuser.h:950
#define DT_LEFT
Definition: winuser.h:534
#define DT_MODIFYSTRING
Definition: winuser.h:535
#define DT_VCENTER
Definition: winuser.h:543
#define COLOR_3DHILIGHT
Definition: winuser.h:948
long left
Definition: dcommon.idl:29
const uint16_t * LPCWSTR
Definition: typedefs.h:57
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1382
#define TRANSPARENT
Definition: wingdi.h:950
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:917

◆ OnSize()

LRESULT CConsoleWnd::OnSize ( UINT  nMessage,
WPARAM  wParam,
LPARAM  lParam,
BOOL &  bHandled 
)

Definition at line 83 of file CConsoleWnd.cpp.

84 {
86 return DefMDIChildProc(this->m_hWnd, WM_SIZE, wParam, lParam);
87 }
VOID UpdateLayout()
WPARAM wParam
Definition: combotst.c:138
#define WM_SIZE
Definition: winuser.h:1639

◆ QueryConsoleVerb()

STDMETHODIMP CConsoleWnd::QueryConsoleVerb ( LPCONSOLEVERB *  ppConsoleVerb)

Implements IConsole.

Definition at line 395 of file CConsoleWnd.cpp.

396 {
397 DPRINT("%s()\n", __FUNCTION__);
398 __debugbreak();
399 return E_NOTIMPL;
400 }

◆ QueryInterface()

STDMETHODIMP CConsoleWnd::QueryInterface ( REFIID  riid,
void **  ppvObject 
)

Implements IUnknown.

Definition at line 288 of file CConsoleWnd.cpp.

289 {
290 if (riid == IID_IUnknown || riid == IID_IConsole)
291 {
292 *ppvObject = static_cast<IConsole*>(this);
293 AddRef();
294 return S_OK;
295 }
296 else if (riid == IID_IConsole2)
297 {
298 *ppvObject = static_cast<IConsole2*>(this);
299 AddRef();
300 return S_OK;
301 }
302 else if (riid == IID_IConsoleNameSpace)
303 {
304 *ppvObject = static_cast<IConsoleNameSpace*>(this);
305 AddRef();
306 return S_OK;
307 }
308 else if (riid == IID_IConsoleNameSpace2)
309 {
310 *ppvObject = static_cast<IConsoleNameSpace2*>(this);
311 AddRef();
312 return S_OK;
313 }
314 else
315 {
316 CComHeapPtr<OLECHAR> guidstr;
317 HRESULT hr = StringFromCLSID(riid, &guidstr);
318 if (SUCCEEDED(hr))
319 DPRINT1("Unhandled riid: %S\n", (PCWSTR)guidstr);
320 else
321 DPRINT1("Unhandled riid\n");
322 }
323
324
325 *ppvObject = NULL;
326 return E_NOINTERFACE;
327 }
#define DPRINT1
Definition: precomp.h:8
const GUID IID_IUnknown
HRESULT hr
Definition: delayimp.cpp:582
HRESULT WINAPI StringFromCLSID(REFCLSID clsid, LPOLESTR *str)
Definition: combase.c:1515
REFIID riid
Definition: atlbase.h:39
ULONG AddRef()
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ QueryResultImageList()

STDMETHODIMP CConsoleWnd::QueryResultImageList ( LPIMAGELIST *  ppImageList)

Implements IConsole.

Definition at line 374 of file CConsoleWnd.cpp.

375 {
376 DPRINT("%s()\n", __FUNCTION__);
377 __debugbreak();
378 return E_NOTIMPL;
379 }

◆ QueryResultView()

STDMETHODIMP CConsoleWnd::QueryResultView ( LPUNKNOWN *  pUnknown)

Implements IConsole.

Definition at line 356 of file CConsoleWnd.cpp.

357 {
358 DPRINT("%s()\n", __FUNCTION__);
359 __debugbreak();
360 return E_NOTIMPL;
361 }

◆ QueryScopeImageList()

STDMETHODIMP CConsoleWnd::QueryScopeImageList ( LPIMAGELIST *  ppImageList)

Implements IConsole.

Definition at line 363 of file CConsoleWnd.cpp.

364 {
365 DPRINT("%s(%p)\n", __FUNCTION__);
366 if (!ppImageList)
367 return E_INVALIDARG;
368
369 __debugbreak();
370 //*ppImageList = m_ScopeImageList;
371 return S_OK;
372 }
#define E_INVALIDARG
Definition: ddrawi.h:101

◆ SaveView()

VOID CConsoleWnd::SaveView ( MscFile *  mscFile,
IXMLDOMElement *  pParentElement 
)

Definition at line 252 of file CConsoleWnd.cpp.

253 {
254 IXMLDOMElement *pViewElement = NULL;
255 IXMLDOMElement *pViewOptionsElement = NULL;
256 WCHAR szBuffer[32];
257 HRESULT hr = S_OK;
258
259 /* <View ID="1" ScopePaneWidth="292" ActionsPaneWidth="-1"> */
260 CHK_HR(mscFile->CreateAndAddElementNode(L"View", pParentElement, &pViewElement));
261 _swprintf(szBuffer, L"%d", m_ViewId);
262 CHK_HR(mscFile->CreateAndAddAttributeNode(L"ID", szBuffer, pViewElement));
263 _swprintf(szBuffer, L"%d", m_iTreeViewWidth);
264 CHK_HR(mscFile->CreateAndAddAttributeNode(L"ScopePaneWidth", szBuffer, pViewElement));
265 _swprintf(szBuffer, L"%d", m_iActionsPaneWidth);
266 CHK_HR(mscFile->CreateAndAddAttributeNode(L"ActionsPaneWidth", szBuffer, pViewElement));
267
268 mscFile->SaveWindowPlacement(this, pViewElement);
269
270 /* <ViewOptions ViewMode="Report" ScopePaneVisible="true" ActionsPaneVisible="true" DescriptionBarVisible="false" DefaultColumn0Width="200" DefaultColumn1Width="0"/> */
271 CHK_HR(mscFile->CreateAndAddElementNode(L"ViewOptions", pViewElement, &pViewOptionsElement));
272 CHK_HR(mscFile->CreateAndAddAttributeNode(L"ViewMode", L"Report", pViewOptionsElement)); /* FIXME */
273 CHK_HR(mscFile->CreateAndAddAttributeNode(L"ScopePaneVisible", IsTreeViewVisible() ? L"true" : L"false", pViewOptionsElement));
274 if (!IsStatusBarVisible())
275 CHK_HR(mscFile->CreateAndAddAttributeNode(L"NoStatusBar", L"true", pViewOptionsElement));
276 CHK_HR(mscFile->CreateAndAddAttributeNode(L"ActionsPaneVisible", IsActionsPaneVisible() ? L"true" : L"false", pViewOptionsElement));
277 CHK_HR(mscFile->CreateAndAddAttributeNode(L"DescriptionBarVisible", IsDescriptionBarVisible() ? L"true" : L"false", pViewOptionsElement));
278 CHK_HR(mscFile->CreateAndAddAttributeNode(L"DefaultColumn0Width", L"200", pViewOptionsElement)); /* FIXME */
279 CHK_HR(mscFile->CreateAndAddAttributeNode(L"DefaultColumn1Width", L"0", pViewOptionsElement)); /* FIXME */
280 SAFE_RELEASE(pViewOptionsElement); /* </ViewOptions> */
281
282 CleanUp:
283 SAFE_RELEASE(pViewElement); /* </View> */
284 }
BOOL IsDescriptionBarVisible()
BOOL IsTreeViewVisible()
BOOL IsStatusBarVisible()
BOOL IsActionsPaneVisible()
HRESULT SaveWindowPlacement(CWindow *pWindow, IXMLDOMElement *pParentNode)
Definition: mscfile.cpp:264
HRESULT CreateAndAddAttributeNode(PCWSTR wszName, PCWSTR wszValue, IXMLDOMElement *pParent)
Definition: mscfile.cpp:135
HRESULT CreateAndAddElementNode(PCWSTR wszName, IXMLDOMNode *pParent, IXMLDOMElement **ppElement=NULL)
Definition: mscfile.cpp:199
#define _swprintf(buf, format,...)
Definition: sprintf.c:56
#define SAFE_RELEASE(p)
Definition: mscfile.h:15
#define CHK_HR(stmt)
Definition: mscfile.h:9

Referenced by CMainWnd::SaveMscFile().

◆ SelectScopeItem()

STDMETHODIMP CConsoleWnd::SelectScopeItem ( HSCOPEITEM  hScopeItem)

Implements IConsole.

Definition at line 402 of file CConsoleWnd.cpp.

403 {
404 DPRINT("%s()\n", __FUNCTION__);
405 __debugbreak();
406 return E_NOTIMPL;
407 }

◆ SetActionsPaneVisible()

VOID CConsoleWnd::SetActionsPaneVisible ( BOOL  bVisible)

Definition at line 179 of file CConsoleWnd.cpp.

180 {
181 m_bActionsPaneVisible = bVisible;
182 UpdateLayout();
183 }

◆ SetDescriptionBarVisible()

VOID CConsoleWnd::SetDescriptionBarVisible ( BOOL  bVisible)

Definition at line 168 of file CConsoleWnd.cpp.

169 {
170 m_bDescriptionBarVisible = bVisible;
171 UpdateLayout();
172 }

◆ SetHeader()

STDMETHODIMP CConsoleWnd::SetHeader ( LPHEADERCTRL  pHeader)

Implements IConsole.

Definition at line 342 of file CConsoleWnd.cpp.

343 {
344 DPRINT("%s()\n", __FUNCTION__);
345 __debugbreak();
346 return E_NOTIMPL;
347 }

◆ SetItem()

STDMETHODIMP CConsoleWnd::SetItem ( LPSCOPEDATAITEM  item)

Implements IConsoleNameSpace.

Definition at line 463 of file CConsoleWnd.cpp.

464 {
465 DPRINT("%s()\n", __FUNCTION__);
466 __debugbreak();
467 return E_NOTIMPL;
468 }

◆ SetStatusBarVisible()

VOID CConsoleWnd::SetStatusBarVisible ( BOOL  bVisible)

Definition at line 157 of file CConsoleWnd.cpp.

158 {
159 m_bStatusBarVisible = bVisible;
160 UpdateLayout();
161 }

◆ SetStatusText()

STDMETHODIMP CConsoleWnd::SetStatusText ( LPOLESTR  pszStatusText)

Implements IConsole2.

Definition at line 440 of file CConsoleWnd.cpp.

441 {
442 DPRINT("%s()\n", __FUNCTION__);
443 __debugbreak();
444 return E_NOTIMPL;
445 }

◆ SetToolbar()

STDMETHODIMP CConsoleWnd::SetToolbar ( LPTOOLBAR  pToolbar)

Implements IConsole.

Definition at line 349 of file CConsoleWnd.cpp.

350 {
351 DPRINT("%s()\n", __FUNCTION__);
352 __debugbreak();
353 return E_NOTIMPL;
354 }

◆ SetTreeViewVisible()

VOID CConsoleWnd::SetTreeViewVisible ( BOOL  bVisible)

Definition at line 146 of file CConsoleWnd.cpp.

147 {
148 m_bTreeViewVisible = bVisible;
149 UpdateLayout();
150 }

◆ STDMETHODIMP_() [1/2]

CConsoleWnd::STDMETHODIMP_ ( ULONG  )

◆ STDMETHODIMP_() [2/2]

CConsoleWnd::STDMETHODIMP_ ( ULONG  )

◆ UpdateAllViews()

STDMETHODIMP CConsoleWnd::UpdateAllViews ( LPDATAOBJECT  lpDataObject,
LPARAM  data,
LONG_PTR  hint 
)

Implements IConsole.

Definition at line 381 of file CConsoleWnd.cpp.

382 {
383 DPRINT("%s()\n", __FUNCTION__);
384 __debugbreak();
385 return E_NOTIMPL;
386 }

◆ UpdateLayout()

VOID CConsoleWnd::UpdateLayout ( )
private

Definition at line 185 of file CConsoleWnd.cpp.

186 {
187 RECT Rect;
188 int iTreeViewWidth, iTreeViewHeight;
189 int iListViewPosX, iListViewPosY = 0;
190 int iListViewWidth, iListViewHeight;
191
193 int iClientHeight = Rect.bottom - Rect.top;
194 int iClientWidth = Rect.right - Rect.left;
195
196 int iStatusHeight = 0;
197
198 int iDescriptionBarHeight = 0;
199
201 {
202 iTreeViewWidth = m_iTreeViewWidth;
203 iListViewPosX = m_iTreeViewWidth + m_iSplitterWidth;
204 iListViewWidth = iClientWidth - m_iTreeViewWidth - m_iSplitterWidth;
205 }
206 else
207 {
208 iTreeViewWidth = 0;
209 iListViewPosX = 0;
210 iListViewWidth = iClientWidth;
211 }
212
213 iTreeViewHeight = iClientHeight;
214 iListViewHeight = iClientHeight;
215
217 {
218 iStatusHeight = m_iStatusBarHeight;
219 iTreeViewHeight -= iStatusHeight;
220 iListViewHeight -= iStatusHeight;
221 }
222
224 {
225 iDescriptionBarHeight = 24;
226 iListViewPosY += iDescriptionBarHeight;
227 iListViewHeight -= iDescriptionBarHeight;
228 }
229
231 {
232 iListViewWidth -= (m_iActionsPaneWidth + m_iSplitterWidth);
233 }
234
235 /* Move the status bar */
236 m_StatusBar.MoveWindow(0, iClientHeight - iStatusHeight, iClientWidth, iStatusHeight);
237
238 /* Move the tree view */
239 m_TreeView.MoveWindow(0, 0, iTreeViewWidth, iTreeViewHeight);
240
241 /* Move the list view */
242 m_ListView.MoveWindow(iListViewPosX, iListViewPosY, iListViewWidth, iListViewHeight);
243
244 m_DescriptionBar.MoveWindow(iListViewPosX, 0, iListViewWidth, iDescriptionBarHeight);
245 }
BOOL MoveWindow(int x, int y, int nWidth, int nHeight, BOOL bRepaint=TRUE)
Definition: atlwin.h:1026

Referenced by OnSize(), SetActionsPaneVisible(), SetDescriptionBarVisible(), SetStatusBarVisible(), and SetTreeViewVisible().

◆ UpdateTreeView()

VOID CConsoleWnd::UpdateTreeView ( )
private

Definition at line 135 of file CConsoleWnd.cpp.

136 {
139 }
BOOL DeleteItem(HTREEITEM i)
Definition: rosctrls.h:545
#define TVI_ROOT
Definition: commctrl.h:3373

Referenced by OnCreate(), and UpdateView().

◆ UpdateView()

VOID CConsoleWnd::UpdateView ( )

Definition at line 247 of file CConsoleWnd.cpp.

248 {
250 }

Referenced by CMainWnd::UpdateViews().

Member Data Documentation

◆ m_bActionsPaneVisible

BOOL CConsoleWnd::m_bActionsPaneVisible
private

Definition at line 33 of file CConsoleWnd.h.

Referenced by IsActionsPaneVisible(), OnCreate(), SetActionsPaneVisible(), and UpdateLayout().

◆ m_bDescriptionBarVisible

BOOL CConsoleWnd::m_bDescriptionBarVisible
private

◆ m_bStatusBarVisible

BOOL CConsoleWnd::m_bStatusBarVisible
private

Definition at line 34 of file CConsoleWnd.h.

Referenced by IsStatusBarVisible(), OnCreate(), SetStatusBarVisible(), and UpdateLayout().

◆ m_bTreeViewVisible

BOOL CConsoleWnd::m_bTreeViewVisible
private

Definition at line 32 of file CConsoleWnd.h.

Referenced by IsTreeViewVisible(), OnCreate(), SetTreeViewVisible(), and UpdateLayout().

◆ m_DescriptionBar

CWindow CConsoleWnd::m_DescriptionBar
private

Definition at line 25 of file CConsoleWnd.h.

Referenced by OnCreate(), and UpdateLayout().

◆ m_iActionsPaneWidth

int CConsoleWnd::m_iActionsPaneWidth
private

Definition at line 27 of file CConsoleWnd.h.

Referenced by OnCreate(), SaveView(), and UpdateLayout().

◆ m_iSplitOffset

int CConsoleWnd::m_iSplitOffset
private

Definition at line 29 of file CConsoleWnd.h.

◆ m_iSplitSide

int CConsoleWnd::m_iSplitSide
private

Definition at line 30 of file CConsoleWnd.h.

Referenced by OnCreate().

◆ m_iSplitterWidth

int CConsoleWnd::m_iSplitterWidth
private

Definition at line 28 of file CConsoleWnd.h.

Referenced by OnCreate(), and UpdateLayout().

◆ m_iStatusBarHeight

int CConsoleWnd::m_iStatusBarHeight
private

Definition at line 31 of file CConsoleWnd.h.

Referenced by OnCreate(), and UpdateLayout().

◆ m_iTreeViewWidth

int CConsoleWnd::m_iTreeViewWidth
private

Definition at line 26 of file CConsoleWnd.h.

Referenced by OnCreate(), SaveView(), and UpdateLayout().

◆ m_ListView

CListView CConsoleWnd::m_ListView
private

Definition at line 23 of file CConsoleWnd.h.

Referenced by OnCreate(), and UpdateLayout().

◆ m_MainWnd

CMainWnd* CConsoleWnd::m_MainWnd
private

Definition at line 21 of file CConsoleWnd.h.

Referenced by CConsoleWnd(), OnCreate(), and OnDestroy().

◆ m_StatusBar

CStatusBar CConsoleWnd::m_StatusBar
private

Definition at line 24 of file CConsoleWnd.h.

Referenced by OnCreate(), and UpdateLayout().

◆ m_TreeView

CTreeView CConsoleWnd::m_TreeView
private

Definition at line 22 of file CConsoleWnd.h.

Referenced by AddTreeViewItemRecursive(), OnCreate(), UpdateLayout(), and UpdateTreeView().

◆ m_ViewId

int CConsoleWnd::m_ViewId
private

Definition at line 20 of file CConsoleWnd.h.

Referenced by OnCreate(), and SaveView().

◆ m_ViewRootNode

CSnapin* CConsoleWnd::m_ViewRootNode
private

Definition at line 37 of file CConsoleWnd.h.

Referenced by CConsoleWnd(), and UpdateTreeView().

◆ m_ViewSelectedNode

CSnapin* CConsoleWnd::m_ViewSelectedNode
private

Definition at line 38 of file CConsoleWnd.h.

Referenced by AddTreeViewItemRecursive(), and CConsoleWnd().


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