![]() |
|
|
|
#1
|
|||
|
|||
|
As an IT person in a school, we're often running around and completing the same task on many machines. For instance, we want to adjust one little setting on all the computers. I've researched this a bit in the multiboxing communities, but there doesn't seem to be a free, simple executable that I could drop on my clients and control them all simultaneously. So... I want to write my own.
The question is... where do I start? I've done a lot of Delphi programming, but I've never tried to write one that communicates across a network. Let alone to 30 machines at once. My goal would be to have a "server" app and then a "client" app. If I could broadcast mouse movements and clicks, that'd be great. If I could also broadcast keystrokes... that'd be awesome. Any thoughts? Thanks! |
|
#2
|
|||
|
|||
|
I doubt this is possible to send messages over a network...
What you could do is write a message recorder/player app... Just record on 1 pc, copy the app including the recording to the other pc's and execute... |
|
#3
|
|||
|
|||
|
Actually, I got it working for mouse clicks. I use TIDudpserver and client and simply set the host to the broadcast IP (ex. 192.168.1.255 for a Class C subnet) then send out the message. It worked perfectly. Now to figure out how to add keystrokes. I'll post more complete code when finished.
|
|
#4
|
|||
|
|||
|
So here's the basic of what I did to facilitate sending the mouse over the network. To conserve bandwidth, I only sent clicks, but I had easily replicated mouse movements as well.
MASTER: Code:
procedure TForm1.Timer1Timer(Sender: TObject);
var
pt : TPoint;
x,y : string;
begin
if GetAsyncKeyState(VK_LBUTTON) >= 0 then
wassent := false;
if (wassent = false) and (GetAsyncKeyState(VK_LBUTTON) < 0) then
begin
wassent := true;
getcursorpos(pt);
x := inttostr(pt.X);
y := inttostr(pt.y);
idudpclient1.Send(x+','+y);
end;
end;
MINION: Code:
procedure TForm1.IdUDPServer1UDPRead(AThread: TIdUDPListenerThread;
AData: TBytes; ABinding: TIdSocketHandle);
var
LMsg: string;
cpos, x,y : integer;
begin
if Length(AData) <> 0 then
begin
LMsg := BytesToString(AData);
cpos := pos(',',lmsg);
x := strtoint(copy(lMsg, 1, cpos-1));
y := strtoint(copy(lmsg,cpos+1,maxint));
setcursorpos(x,y);
Mouse_Event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
Mouse_Event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
end;
end;
http://sites.google.com/site/fragsixtyeight/home/mb |
![]() |
| Tags |
| broadcast, lab, mouse, multibox, network |
| Thread Tools | |
| Display Modes | |
|
|