Click here to Skip to main content
15,893,588 members
Articles / Desktop Programming / MFC

Remote Control PCs

Rate me:
Please Sign up or sign in to vote.
4.60/5 (150 votes)
20 Sep 2013GPL3 898.9K   63.9K   489  
Two projects that work together to remote control PCs across a LAN.
#pragma once

#include <winsvc.h>

class CControlService
{
public:
	CControlService(const TCHAR * pszServiceName = NULL);
	~CControlService();

public:
	bool Open(const TCHAR * pszServiceName);
	void Close();
	bool IsOpen();
	bool IsAvailable();
	bool IsRunning();
	bool IsPaused();
	bool IsStopped();
	bool IsPending();
	bool Start();
	DWORD Stop();
	DWORD Pause();
	DWORD Continue();
	DWORD UserSync(DWORD dwOp = 0);
	bool Install(const TCHAR * pszServiceName,const TCHAR * pszDescription,const TCHAR * pszFileName);
	bool Remove(const TCHAR * pszServiceName);

protected:
	DWORD Query();
	DWORD Control(DWORD dwControl);

protected:
	SC_HANDLE m_hSCM;
	SC_HANDLE m_hService;
};

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 GNU General Public License (GPLv3)


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

Comments and Discussions