• 大小: 581KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-06
  • 语言: C/C++
  • 标签: 远程控制  

资源简介

经典的PC远程控制,可实现远程桌面的监控与控制,适合初学者,以及修改

资源截图

代码片段和文件信息


#include 
#include 
#include 
#include “client.h“
#include “command.h“
#include “gdi.h“
#include “HuffCompress.h“
#include “RLE.h“
#include “time.h“

#define DEFAULT_PORT        5150
#define REFRESH_MSG “REFRESH“
#define SETFLAGS XP1_GUARANTEED_DELIVERY|XP1_GUARANTEED_ORDER
#define NOTSETFLAGS XP1_CONNECTIONLESS
#define LPBMIH LPBITMAPINFOHEADER

UINT    port=DEFAULT_PORT;
BOOL bSendOnly = FALSE;
BOOL fSending = FALSE;
BOOL fReceiving = FALSE;
DWORD iLen;
char *pDIBitmap;
int iScreenWidthiScreenHeight;
int iWidthiHeightiWidthXiHeightY;
int iWidth1iWidth2iHeight1iHeight2;
int iCompressionLevel;
BOOL fDIBitmap = FALSE;
LPBMIH lpBitmapIH;
struct sockaddr_in server;
SOCKET sClient;
BOOL fRefreshing = FALSE;
BOOL fConnected = FALSE;
int nGridX = 8nGridY = 4;
BOOL fGridX = FALSEfGridY = FALSE;
WORD bmBitsPixel = 4;

struct GdiList GdiStart;
struct GdiList *pGdiNode;

int SelectProtocols(DWORD dwSetFlagsDWORD dwNotSetFlagsLPWSAPROTOCOL_INFO lpProtocolBufferLPDWORD lpdwBufferLengthWSAPROTOCOL_INFO *Protocol);

void InitGrids()
{
int iLoopjLoopnGrid;
struct GdiDS Gdi;

Gdi.fDIBitmap = FALSE;
GdiStart.pNext = NULL;
pGdiNode = &GdiStart;

if ((nGridX > 0) && (nGridY > 0))
{
for (iLoop = 0;iLoop < nGridX;iLoop++)
{
for (jLoop = 0;jLoop < nGridY;jLoop++)
{
Gdi.iGridX = iLoop;
Gdi.iGridY = jLoop;

pGdiNode = Add_Gdi(pGdiNodeGdi);
}
}
}
else
{
nGrid = max(nGridXnGridY);
for (iLoop = 0;iLoop < nGrid;iLoop++)
{
if (nGridX > 0)
Gdi.iGridX = iLoop;
else
Gdi.iGridX = 0;

if (nGridY > 0)
Gdi.iGridY = iLoop;
else
Gdi.iGridY = 0;

pGdiNode = Add_Gdi(pGdiNodeGdi);
}
}

if (nGridX > 0)
iWidthX = iWidth/nGridX;
else
iWidthX = iWidth;

if (nGridY > 0)
iHeightY = iHeight/nGridY;
else
iHeightY = iHeight;
}


int LoadWinsock(HWND hWndchar *szIP)
{
WSADATA wsd;
DWORD dwLen;
int nRetnZero;
LPBYTE pBuf;
WSAPROTOCOL_INFO Protocol;
char szString[81];
char szMessage[81];

if (WSAStartup(0x202&wsd) != 0)
{
MessageBox(NULL“hehe““Client Socket Error“MB_OK);
return 1;
}

dwLen = 0;
nRet = WSAEnumProtocols(NULLNULL&dwLen);
if (nRet == SOCKET_ERROR)
{
if (WSAGetLastError() != WSAENOBUFS)
return 1;
}

pBuf = malloc(dwLen);

nRet = SelectProtocols(SETFLAGSNOTSETFLAGS(LPWSAPROTOCOL_INFO)pBuf&dwLen&Protocol);

free(pBuf);

sClient = WSASocket(AF_INETSOCK_STREAMIPPROTO_IPNULL0SOCK_STREAM);
if (sClient == INVALID_SOCKET)
return 1;

nZero = 0;
setsockopt(sClientSOL_SOCKETSO_RCVBUF(char *)&nZerosizeof(nZero));

server.sin_family = AF_INET;
server.sin_port = htons(port);
server.sin_addr.s_addr = inet_addr(szIP);

if (connect(sClient(struct sockaddr *)&serversizeof(server)) == SOCKET_ERROR)
{
memset(szString‘\0‘sizeof(szString

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2010-10-21 22:11  Client\
     文件          52  2000-03-09 16:14  Client\afiedt.buf
     文件       32525  1998-06-15 00:00  Client\AFXRES.H
     文件       15027  2008-06-05 21:35  Client\client.c
     文件         688  2003-07-10 14:11  Client\client.h
     文件        5497  2000-05-01 08:46  Client\ClientWindow.001
     文件        5803  2003-07-09 17:45  Client\ClientWindow.dsp
     文件         547  2000-05-01 13:04  Client\ClientWindow.dsw
     文件        7290  2000-01-18 09:19  Client\ClientWindow.mak
     文件      304128  2008-06-05 22:07  Client\ClientWindow.ncb
     文件       53760  2008-06-05 22:07  Client\ClientWindow.opt
     文件         258  2008-06-05 21:35  Client\ClientWindow.plg
     文件         707  2008-06-05 21:35  Client\ColorMode.cpp
     文件         353  2008-06-05 21:35  Client\ColorMode.h
     文件         600  2003-07-10 15:47  Client\Command.c
     文件         350  2003-07-10 15:45  Client\Command.h
     文件        1329  2008-06-05 21:35  Client\Compression.cpp
     文件         367  2008-06-05 21:35  Client\Compression.h
     文件        1007  2003-07-10 15:47  Client\Gdi.c
     文件         482  2008-06-05 22:07  Client\Gdi.h
     文件        1596  2003-07-10 15:50  Client\GridSpacing.cpp
     文件         514  2008-06-05 21:35  Client\GridSpacing.h
     文件       23839  2003-07-10 15:52  Client\HuffCompress.c
     文件         958  2003-07-10 15:50  Client\HuffCompress.h
     文件         468  2000-01-21 12:57  Client\IDB_NORECEIVE.BMP
     文件         468  2000-01-21 12:57  Client\IDB_NOSEND.BMP
     文件         468  2000-01-21 12:57  Client\IDB_RECEIVE.BMP
     文件         468  2000-01-21 12:57  Client\IDB_SEND.BMP
     目录           0  2010-10-21 22:11  Client\Include\
     文件       60113  1998-06-15 00:00  Client\Include\AFX.H
     文件       19188  1998-06-15 00:00  Client\Include\AFX.INL
............此处省略218个文件信息

评论

共有 条评论