Click here to Skip to main content
15,894,539 members
Articles / Desktop Programming / MFC

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

Rate me:
Please Sign up or sign in to vote.
4.80/5 (35 votes)
1 Apr 2012CPOL5 min read 157.1K   8.9K   103  
Control certain aspects of machines sitting remotely, without having to install and trigger an application on the remote machine.
// ProgressWndThread.cpp : implementation file
//

#include "stdafx.h"
#include "RemoteAdmin.h"
#include "ProgressWndThread.h"
#include "ProgressDlg.h"
#include "RemoteAdminDoc.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


IMPLEMENT_DYNCREATE(CProgressWndThread, CWinThread)

CProgressWndThread::CProgressWndThread()
{
}

CProgressWndThread::~CProgressWndThread()
{
	m_pRemoteAdminDoc->SetVisualProgressThread(NULL);
}


BOOL CProgressWndThread::InitInstance()
{
	
	CProgressDlg* pDlg = new CProgressDlg;
	pDlg->Create();
	pDlg->ShowWindow(SW_NORMAL);
    pDlg->CenterWindow();
	pDlg->SetDocument(m_pRemoteAdminDoc);
	pDlg->SetTimer(TIMER_STEP, 100, NULL);
    pDlg->SetProgressText(_T("Please wait....."));
    pDlg->SetDlgTitle(_T("Connection progress"));
	
	// Assign the thread window, with this dialog
	m_pMainWnd = pDlg;

    return TRUE;
}

int CProgressWndThread::ExitInstance()
{
	// TODO:  perform any per-thread cleanup here
	return CWinThread::ExitInstance();
}

void CProgressWndThread::SetDocument(CRemoteAdminDoc* pRemoteAdminDoc)
{
	ASSERT(pRemoteAdminDoc);

	m_pRemoteAdminDoc = pRemoteAdminDoc;
}

void CProgressWndThread::SetProgressText(CString strDlgProgressTxt)
{
	CProgressDlg* pDlg = static_cast<CProgressDlg*>(m_pMainWnd);
	pDlg->SetProgressText(strDlgProgressTxt);
}

BEGIN_MESSAGE_MAP(CProgressWndThread, CWinThread)
	//{{AFX_MSG_MAP(CProgressWndThread)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CProgressWndThread message handlers

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)


Written By
Web Developer
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions