|
用delphi实现冰河的远程屏幕操作功能(5) Log(Format('%-20s %d', ['Message', MsgNum]));
if MsgNum = MSG_LOGON then begin LoggedOn := (AnsiCompareText(Data, PassEdit.Text) = 0); if LoggedOn then begin SendMsg(MSG_LOGON, '1', Socket) end else begin SendMsg(MSG_LOGON, '0', Socket); end; exit; end;
if not LoggedOn then begin Log('Denied Access!'); SendMsg(MSG_STAT_MSG, 'Invalid PassWord', Socket); Socket.Close; exit; end;
if MsgNum = MSG_REFRESH then begin Log('Screen Capture'); SendMsg(MSG_STAT_MSG, 'Screen Capture', Socket); GetScreen(bmp, ViewMode); Log('Compressing Bitmap'); SendMsg(MSG_STAT_MSG, 'Screen Compression', Socket); CompressBitmap(bmp, tmp); SaveString(tmp, 'Temp1.txt'); SendMsg(MSG_REFRESH, tmp, Socket); CurBmp.Assign(bmp); bmp.Free; end;
if MsgNum = MSG_SCREEN_UPDATE then begin Send_Screen_Update(Socket); end;
if MsgNum = MSG_CLICK then begin SendMsg(MSG_STAT_MSG, 'Simulating Input', Socket); ProcessClick(Data); // SleepDone will be called when it is finished end;
if MsgNum = MSG_DRAG then begin SendMsg(MSG_STAT_MSG, 'Simulating Input', Socket); ProcessDrag(Data); // SleepDone will be called when it is finished end;
if MsgNum = MSG_KEYS then begin SendMsg(MSG_STAT_MSG, 'Simulating Input', Socket); ProcessKeys(Data); // SleepDone will be called when it is finished end;
if MsgNum = MSG_SEVER_DELAY then begin Move(Data[1], SleepTime, sizeof(integer)); SendMsg(MSG_SEVER_DELAY, '', Socket); end;
if MsgNum = MSG_VIEW_MODE then begin Move(Data[1], x, sizeof(integer)); ViewMode := TViewMode(x); SendMsg(MSG_VIEW_MODE, '', Socket); end;
if MsgNum = MSG_FOCUS_SERVER then begin if TrayIcon1.Active then RemoteControl1Click(nil);
|