The sample code for this TP provides the ability to control a text-mode program on a remote computer. AREMOTE is a Win32 console application that implements a client and a server. The AREMOTE server is invoked with the name of the text-mode program that the client wishes to control remotely. The AREMOTE client redirects stdin (keyboard input) from the client to the AREMOTE server. In turn, the AREMOTE server redirects stdin and stderr from the program being controlled back to the AREMOTE client.
The syntax of the command line to start the client end of AREMOTE is as follows:
aremote /C ServerLU [/T TPName] [/P TPName] [/L LocalLU]
[/M Modename] [/N Lines] [/F Color] [/B Color]
where
The syntax of the command line to start the server end of AREMOTE is as follows:
aremote /S Cmd [/T TPName] [/M Modename] [/F Color] [/B Color]
where
The stdout and stderr from the command executed at the remote end is sent across the link and printed to stdout on the client. The stdin from the client is sent across the link and becomes the stdin for the command executed at the remote end.
The APPC remote installer (ARSETUP) included with this sample brings up a dialog box that prompts for TP configuration information. The information is then placed in the registry under Windows NT or in the WIN.INI file under Windows 3.x. The WIN32 compiler flag specifies that the Windows NT version of ARSETUP should be built, while the WINDOWS flag specifies the Windows 3.x version of ARSETUP.
The AREMOTE server can also be configured to run as a Windows NT service using the ARSETUP sample utility included in the same subdirectory on the CD-ROM.
The AREMOTE client can exit by inputting the following character sequences:
%cQ : Quit but leave the AREMOTE server running.
%cK : Exit and stop the AREMOTE server.
Other special client commands include the following:
%cM : Send a message to the AREMOTE server.
%cP : Show a popup on the AREMOTE server.
%cS : Report the status of the AREMOTE server.
%cH : Provide help describing these special client commands.