Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

Remote Processes and Machine control of Windows NT based systems (2000/XP)

, 1 Apr 2012
Control certain aspects of machines sitting remotely, without having to install and trigger an application on the remote machine.
#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

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Prateek Kaul
Web Developer
India India
No Biography provided

| Advertise | Privacy | Mobile
Web04 | 2.8.140926.1 | Last Updated 1 Apr 2012
Article Copyright 2003 by Prateek Kaul
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid