Код |
procedure TForm1.IdTCPServer1Execute(AThread: TIdPeerThread);
var
strText: string;
width, height, i: Integer;
dc: HDC;
begin
//Принимаем от клиента строку
strText := AThread.Connection.ReadLn; исправил на AContext.Connection.IOHandler.ReadLn
//Определяем, что нужно выполнить
if (strText = 'get_screen_height') then
//Возвратим высоту экрана
Athread.Connection.WriteInteger(Screen.Height) а тут на дальше не получаетс AContext.Connection....?
else if (strText = 'get_screen_width') then
//Возвратим ширину экрана
Athread.Connection.WriteInteger(Screen.Width)
else if (strText = 'get_screen_colors') then
begin
//Возвратим количество бит на точку
dc := GetDC(0);
Athread.Connection.WriteInteger(GetDeviceCaps(dc, BITSPIXEL));
ReleaseDC(0, dc);
end
else if (strText = 'get_screen') then
//Возвратим полноразмерную копию экрана
SendScreen(Screen.Width, Screen.Height, AThread.Connection)
else begin //строка вида 'get_screen:x,y'
//Определеним значения высоты и ширины, переданные пользователем
strText := Copy(strText, 12,Length(strText)-11);
i := Pos(',', strText); //Положение запятой
width := StrToInt(Copy(strText, 1, i-1));
height := StrToInt(Copy(strText, i+1, Length(strText)-i));
//Возвратим копию экрана
SendScreen(width, height, AThread.Connection);
end;
end;
|
вообще много мороки с дельфи 7 и дельфа 2006 резко отличаются от ХЕ
в uses подставлял IOHandler сейчас там writeln readln , но ругается нет файла dcu.
|