forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


PC Anywhere Clone/Client/Server

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 762
Location: Rockeledge, GA

PostPosted: Tue Oct 29, 2002 8:23 pm    Post subject: PC Anywhere Clone/Client/Server Reply with quote

WARNING:
Code contains unnecesary stuff, actually got the ideal from a copy screen to second monitor program I made, so you might see some odd stuff considering I just built off that code rather than start from scratch.

Also may have some debugging code, I recommend you be ready to make minor adjustments and changes before really using.

IP addresses need to be changed for one, it would not be hard to make a customization window.

CLIENT

Code:

option errortrap,evloop
external vdsconv.dll
external @path(%0)vdsdll.dll,
DLL Socket, Addr,172.156.177.145
DLL socket,Port,888
DLL Socket, Client

title copyscreen
  DIALOG CREATE,CopyScreen,-1,0,740,580,resizable
  DIALOG ADD,MENU,&Mouse Click,&Double,&Position
  DIALOG ADD,MENU,&Keyboard Keys,&Enter|Enter,&Escape|Esc,&Insert|Ins,&Home|Home,&Pageup|Pgup,&Pagedown|Pgdn,&Delete|Del,&End|End,&Up|Up,&Down|Down,&Left|Left,&Right|Right,&Backspace
  DIALOG ADD,MENU,&Refresh,&Update
  DIALOG ADD,BITMAP,BITMAP1,0,0,@sysinfo(screenwidth),@sysinfo(screenheight),cap.bmp,,click
  DIALOG ADD,taskicon,taskicon1,0,0
  DIALOG ADD,list,list1,0,0,0,0
  DIALOG SHOW

  DIALOG CREATE,New Dialog,-1,0,403,385,resizable,class copyclient,ontop
  Dialog add,menu,&Text,&Send
  DIALOG ADD,EDIT,EDIT1,480,0,640,96,,multi,scroll
  DIALOG SHOW


  dialog select,0

    %%count = 0
 
 goto evloop
 
  :evloop
%%event = @event()
if %%event
goto %%event
else
end
directory change,@path(%0)
wait .1
%%count = @succ(%%count)
if @equal(%%count,10)
%%count = 0
goto updatemenu
else
end
goto evloop

:doublemenu
%%double = true
goto evloop

:updatemenu
rem wait
dll http,download,http://172.156.177.145/cap.gif,@path(%0)cap.gif

:convertnow
convert gif2bmp,@path(%0)cap.gif,@path(%0)cap.bmp
dialog set,bitmap1,@path(%0)cap.bmp
goto evloop

:taskicon1click
window normal,copyscreen config
goto evloop

:close
exit

:bitmap1click
parse "%B;%X;%Y",@click(BXY)
if @equal(%%double,true)
%%double = false
%%list1 = double
goto skiplr
else
end
if @equal(%%position,true)
%%list1 = position
%%position = false
goto skiplr
else
end

if @equal(%b,right)
%%list1 = right
else
end

if @equal(%b,left)
%%list1 = left
else
end

:skiplr
DLL Socket,send,All,Mouse|%%list1|%y|%x@chr(32)
goto evloop

:resize
parse "%%t;%%l;%%w;%%h",@winpos(#copyclient,TLWH)
dialog select,1
dialog setpos,edit1,0,0,@diff(%%w,10),@diff(%%h,50)
dialog select,0
goto evloop

:backspacemenu
gosub reun
DLL Socket,send,All,Backspace@chr(32)
goto evloop

:rightmenu
gosub reun
DLL Socket,send,All,Right@chr(32)
goto evloop

:leftmenu
gosub reun
DLL Socket,send,All,left@chr(32)
goto evloop

:downmenu
gosub reun
DLL Socket,send,All,Down@chr(32)
goto evloop


:upmenu
gosub reun
DLL Socket,send,All,Up@chr(32)
goto evloop

:endmenu
gosub reun
DLL Socket,send,All,End@chr(32)
goto evloop

:deletemenu
gosub reun
DLL Socket,send,All,delete@chr(32)
goto evloop

:pagedownmenu
gosub reun
DLL Socket,send,All,Pagedown@chr(32)
goto evloop


:pageupmenu
gosub reun
DLL Socket,send,All,Pageup@chr(32)
goto evloop

:homemenu
gosub reun
DLL Socket,send,All,Home@chr(32)
goto evloop


:insertmenu
gosub reun
DLL Socket,send,All,insert@chr(32)
goto evloop


:escapemenu
gosub reun
DLL Socket,send,All,Escape@chr(32)
goto evloop


:entermenu
gosub reun
DLL Socket,send,All,Enter@chr(32)
goto evloop


:positionmenu
%%position = true
goto evloop

:sendmenu
gosub reun
dialog select,1
DLL Socket,send,All,Keyboard|@dlgtext(edit1)@chr(32)
dialog select,0
goto evloop

:network
:closec
goto evloop

:error
info @DLL(Socket, Error)
goto evloop

:reun
repeat
wait
until @not(@equal(@winactive(c),copyclient))
exit


SERVER
Code:

external vdsdll.dll,
external vdsconv.dll
external vdshttpd.dll,
httpd events,off
httpd on
httpd defaultdir,@path(%0)
httpd defaultport,80

dll socket,port,888
DLL Socket, Server

option errortrap,evloop

  DIALOG CREATE,CopyScreen Config,-1,0,192,161
  DIALOG ADD,RADIO,RADIO1,6,6,178,72,Processor,Favor Keyboard|Favor Mouse,Favor Mouse
  DIALOG ADD,TEXT,TEXT1,82,8,,,(Keyboard takes more processor)
  DIALOG ADD,BUTTON,BUTTON1,102,8,64,24,OK
  DIALOG ADD,BUTTON,BUTTON2,102,120,64,24,Cancel
  DIALOG ADD,BUTTON,BUTTON3,130,8,176,24,Exit CopyScreen
dialog add,list,list1
dialog add,taskicon,taskicon1
rem  DIALOG SHOW
 
dialog select,0
   
  %%count = 0
 
:evloop
wait 1
%%event = @event()
if %%event
goto %%event
else
end

:update
dll capture,@path(%0)cap.bmp
convert bmp2gif,@path(%0)cap.bmp,@path(%0)cap.gif
goto evloop


:button1button
dialog select,1
if @equal(@dlgtext(radio1),favor keyboard)
inifile write,favor,favor,keyboard
%%favor = keyboard
else
inifile write,favor,favor,mouse
%%favor = mouse
end
dialog select,0
window hide,CopyScreen config
goto evloop

:button2button
window hide,CopyScreen config
goto evloop

:close
:taskicon1click
:button3button
exit

:network
:closec
:accept
%%sock = @DLL(Socket,Data)

parse "%%a;%%b;%%c;%%d",%%sock

REM info %%a

if @equal(%%a,keyboard)
window send,@winactive(),%%b
goto update
else
end

if @equal(%%a,tab)
window send,@winactive(),@tab()
else
end

if @equal(%%a,backspace)
window send,@winactive(),@key(left)@key(del)
else
end

if @equal(%%a,escape)
window send,@winactive(),@esc()
else
end

if @equal(%%a,insert)
window send,@winactive(),@key(ins)
else
end

if @equal(%%a,home)
window send,@winactive(),@key(home)
else
end

if @equal(%%a,pageup)
window send,@winactive(),@key(pgup)
else
end

if @equal(%%a,pagedown)
window send,@winactive(),@key(pgdn)
else
end

if @equal(%%a,end)
window send,@winactive(),@key(end)
else
end

if @equal(%%a,delete)
window send,@winactive(),@key(del)
else
end

if @equal(%%a,enter)
window send,@winactive(),@cr()
else
end

if @equal(%%a,up)
window send,@winactive(),@key(up)
else
end

if @equal(%%a,down)
window send,@winactive(),@key(down)
else
end

if @equal(%%a,left)
window send,@winactive(),@key(left)
else
end

if @equal(%%a,right)
window send,@winactive(),@key(right)
else
end

if @not(@equal(%%a,mouse))
goto update
else
end

if @equal(%%b,right)
window rclick,#progman,%%d,%%c
goto update
else
if @equal(%%b,position)
window position,@winactive(),%%d,%%c
goto update
else
if @equal(%%b,double)
window click,#progman,%%d,%%c
rem wait .01
window click,#progman,%%d,%%c
goto update
else
window click,#progman,%%d,%%c
goto update
end
end
end
end
goto update

:HTTPDCONNECT
info events off
goto evloop
:HTTPDDISCONNECT
goto evloop
:HTTPDGETDOCUMENT
goto evloop
:HTTPDPOSTDOCUMENT
goto evloop


NodNarb
Back to top
View user's profile Send private message AIM Address
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sat Apr 17, 2004 1:29 pm    Post subject: Reply with quote

Wow! Very Happy This is an amazing piece of code. I have to try it. Cool
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Apr 17, 2004 4:03 pm    Post subject: Reply with quote

I once made a simulair program (a so-called VNC program) and found out how to let it work faster on PCs with only a 56k internet connection. To do this, you should change the code which takes the screenshots into two. The first time it is runned, it should send a screenshot of the whole screen, the second one just a screenshot of the active window (since this is the only one which has input). The client then has to lay the two images over each other, and the person who uses it won't see the different, while it is about 30% faster! Smile
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1562

PostPosted: Sat Apr 17, 2004 4:07 pm    Post subject: Reply with quote

Another method is to keep a database of each pixel on the screen. See if any of the pixels have changed from the last check, if they have changed send the client the new pixel color and change for each pixel that was changed.

This will tell the client to only update parts of the screen that need changing without having to send a huge file each time.

Of course you will need a good processor for this since it will be doing a lot of number crunching to determine changes in each pixel on the screen.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group