⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 machineview.h

📁 vc++网络程序设计实例详解 人民邮电出版社1-2章源码
💻 H
字号:
#ifndef MACHINEVIEW_H
#define MACHINEVIEW_H

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <afxcview.h>

const int MACHINE_IMAGE_ON_NETWORK = 0;
const int MACHINE_IMAGE            = 1;

class CRemoteAdminDoc;
class CMachineInfo;
class CRemoteAdminView;


class CMachineView : public CTreeView
{
	DECLARE_DYNCREATE(CMachineView)
    DECLARE_MESSAGE_MAP()

public:
	virtual ~CMachineView();
	CRemoteAdminDoc* GetDocument();

    HTREEITEM ShowNewMachine(CString strTextToBeShown, CMachineInfo* pMachineInfo);
    void DeleteMachineFromTree(HTREEITEM hMachineToBeDeleted);
	void DeleteMachineFromBeingMonitored(CString strIP, CRemoteAdminView* pRemoteAdminView);
	BOOL AddMachine(CString strIP, CString strPassword, CRemoteAdminDoc* pRemoteAdminDoc, CRemoteAdminView* pRemoteAdminView);
    CString GetSelectedItemTextInTreeView();
    HTREEITEM GetTreeItemForText(CString strText);

    afx_msg void OnAddMachine();
    afx_msg void OnDeleteMachine();
    
    // ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMachineView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual void OnInitialUpdate(); // called first time after construct
	//}}AFX_VIRTUAL

	
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
   
	CMachineView();  // create from serialization only

	//{{AFX_MSG(CMachineView)
    afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnRefreshProcess();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnExecuteProcess();
	afx_msg void OnShutdownHalt();
    afx_msg void OnShutdownReboot();
	afx_msg void OnShutdownAbort();
	//}}AFX_MSG

    CImageList m_ilMachine;
    HTREEITEM m_hMachineViewRoot;
    void CreateEmptyTree();
    void CreateImageList();
    void CreateTreeRoot();
    void RefreshProcesses(CString strRemoteMachineIP);
};

#ifndef _DEBUG  // debug version in MachineView.cpp
inline CRemoteAdminDoc* CMachineView::GetDocument()
   { return (CRemoteAdminDoc*)m_pDocument; }
#endif

#endif // MACHINEVIEW_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -