Pocket Control PC - PC v1.1 ReadMe
3. Usage
1.Index 2.Installation & Connection 3.Usage 4.For Developpers
3.0) General Process, 3.1) Connecting & Actions, 3.2) Options & Log, 3.3) Automation, 3.4) Macros

3.0) General ProcessTop
The program Pocket Control PC - PC is a 'host' program. It 'listens' a client and receives its command through a communication protocol like TCP/IP that this uses. So, this program begins by listening for a client. When the host listens, the client must connect to the host. Then a connection is achieved. After the connection is established, both sides can exchange information and commands. In our case, the client sends the host specific text commands that the host then interpretates and executes them.

3.1) Connecting & ActionsTop
Click Connection > Begin Listening. The program then begins listening for the client (if your PC is protected by programs, a message may pop-up asking you whether to allow the listening process). In the listening interval, the client must connect to the host (by clicking the Connect button on the client). The listening timeout is about 20 seconds, but there are options to re-listen automatically upon timeout. Also, note that the client must be first connected to the PC via TCP/IP (explained on the Installation & Connection page).
When the client connects, the program shows a 'Connected' message and you're basically done with the server. When the client and server (PC) connect, the client can then send commands. If you then want to disconnect, click Connection > Disconnect.
Upon connecting, you can do the following actions from the PC:

Send Message: You can send a test or custom message to the remote client. The message is written on the remote client's log. Click Connection > Send Message.

3.2) Options & LogTop
Log: The log is the textbox that occupies a large part of the program's main form. It shows up useful info about what is received, sent or done in the program. It consists of several lines. Each line has a timestamp followed by a description of the event which took place then. To clear the log, click Log > Clear. To save the log to a text file, click Log > Save. Logs are usually used for finding errors or keeping track of events.

Options > Validate Connection: When checked, the server, upon connecting, waits for a 'Validate' message from the client. If it does not receive it, it refuses to execute further commands. If you do not want to validate connections, it would be wise to uncheck this option both on the PC and on the client.
Options > Auto Listen: This list contains useful options for auto-listening after time-intervals or events. If you want to auto-listen when the listening timeout is reached, check 'On Listen Timeout'. If you want to auto-listen after time-intervals, check an appropriate option. If a connection is found after an auto-listening and you want to disable auto-listening automatically when the connection is afterwards dropped, check 'Stop when Disconnect' (this is useful because most people want to auto-listen only for one connection at a time and not auto-listen endlessly).
Options > Auto Listen on Start: Check this if you want the program to start listening automatically when the program starts. This is useful to combine with the Auto Listen option 'On Listen Timeout' and is also useful if you made the program start when the PC starts.
Options > Auto Minimize on Start: Check this if you want the program to minimize to the tray when it starts. This is useful if you made the program start when the PC starts.
Options > Ensure Active Connection: This will be enabled only when connected. If checked, the client and host send validation commands to each other. If they do not receive any response, they disconnect automatically. But it's very useful because if the device is accidentally removed, the programs will automatically disconnect.
Also, be sure that this option is the same for the remote device. When connected, if this option is changed, it also changes on the remote device. If the connection is interrupted without a reason, it may occur that this option is not the same for the device and the PC. So connect again and quickly change this option to synchronize the remote PC's option so that they are the same.
Options > Configure IP: With this, you can configure the IP address and the port to connect to. GPRS is not directly supported yet.
Options > Save Options: Click this to save the option changes to the registry. The options are auto-loaded when the program starts.

File > Minimize to Tray: Click this to minimize the program to a tray icon. The program continues running on the background. Double click the tray icon to show the program again. Left click the tray icon for quick actions.

3.3) AutomationTop
The most important part of the program is its automation. This means to be able to connect to the PC from the client without having to do anything on the PC. Now, I will explain this step by step.
  1. Connection:
    If you connect via bluetooth, read the following: The bluetooth must be always turned on, on the PC. Also, you must have made a pair with the device you connect to. To make a pair, read your bluetooth program's instructions for doing that. Furthermore, you must have your Serial bluetooth service activated both on the PC and on the device (for Smartphones, I had to go to Start > Tools > Serial Bluetooth and check the checkboxes to achieve that).
    From now on, each time you want to connect via bluetooth, you only have to activate bluetooth on your device.
  2. If you connect via Activesync, read the following: In any way you connect to activesync, Activesync must always be running on the background (the program window is hidden but a tray icon is present which you can double-click). This also means that you must have it configured to run upon startup (if this doesn't happen, create a shorcut of the program and put it in Start > Programs > Startup). Also, in the program window, go to File > Connection Settings... and check all the ways you connect to activesync with (If you connect via bluetooth, you have to check the Serial COM checkbox and select the COM port to which the device connects to. This is configured by your bluetooth program. Check its instructions for finding out which COM port your serial bluetooth service occupies).
    From now on, each time you want to connect to activesync, you only have to connect from your device (For smartphones: Go to Start > Activesync. If you connect via bluetooth, go to Menu > Connect via BT).
    Note: In case a PC doesn't have Activesync installed, it would be a great idea to store a copy of Pocket Control PC - PC and of Activesync's installation on your device. In the case a PC doesn't have the programs, you can then transfer them from your device to the PC in some way (like bluetooth or network) so that you can install them.
  3. Program:
    To make the program run upon startup: Create a shorcut for the program and put it in Start > Programs > Startup.
  4. To make the program minimize to the tray on start: Check Options > Auto Minimize on Start and Save Options.
  5. To make the program begin listening on start: Check Options > Auto Listen on Start and Save Options. Further options exist for the listening process. To make the program listen forever check Options > Auto Listen > On Listen Timeout, uncheck Options > Auto Listen > Stop when Disconnect and Save Options.
From now on, you only have to configure your client-device and run the client program to connect to the PC.

3.4) MacrosTop
Macros are small text files used by programs to automate processes. Pocket Control PC - PC uses macros to send and execute commands. This mean you can record your own macros (record the commands you receive from the remote device) and save it to a text file for future execution. For example, if you record mouse moves to a macro, if you execute the macro, the same mouse moves will be made. Macros also have timestamps for real-time execution (time is also recorded along with the commands).
In general, a macro text file looks like this:

Pocket Control PC - PC Macro ##%%## 3/10/2004 5:05:16 pm ##%%## 1.0.0
OUT:3.17:05:16;KeyPress:13,2.
OUT:3.17:05:18;MouseLeftButtonUp
OUT:3.17:05:19;MouseRightMove:30.
IN_:18.21:21:36;KeyPress:27,2.
IN_:18.21:21:37;KeyPress:81,0.
IN_:18.21:21:37;KeyPress:81,2.

The first line gives information about the macro and after that, there is a series of recorded commands. "OUT" commands are the one sent by the program to the remote device. "IN_" commands are the ones received and executed by the program (if the program doesn't recognise the command, it doesn't execute it). When the macro executes the macro, OUT commands are sent to the remote device (if there is a connection) and IN_ commands are executed by the program as if received by the remote device.
The following menus exist for manipulating macros:

Execute file...: A file browser appears. You must select the macro text file to execute. Select one to start executing the macro according to the macro options.
Note: If the macro is executed with timers (one of the macro options), the macro will start being executed. All menus will be disabled. If you wish to stop the execution, Click Stop Macro to interrupt the macro.

Shorcuts: Has a list of managed shorcuts to macro files on the PC. Click a shorcut to start executing its macro. 'Undefined' shorcuts cannot be executed because they do not exist.

Shorcuts > Manage Shorcuts...: Used to manage the macro shorcuts. When clicked, an input dialog appears requesting the position of the shorcut to edit. Allowed values are showed. Enter a number and click Done.
Then, a message box appears. If you wish to edit the shorcut, click Yes. If you wish to delete the shorcut, click No. If you do not want to edit the macro at all, click Yes and when the file browser appears click Cancel.
If you click Yes, a file browser will appear. Select the macro file and click Done.

Start Recording: When clicked, the program enters a record state. That is: when a command is received or sent, it's recorded to memory along with its timestamp. When you finish recording, click Stop - Save.

Stop Rec - Save: Enabled when program has entered record state. When clicked, the program exits record state and a save file dialog appears. Choose the destination .txt file where the macro will be stored.

Options > Execute Incoming Commands: When checked, "IN_" commands are executed.
Options > Execute Outgoing Commands: When checked, "OUT" commands are sent to the remote PC.
Options > Timeless execution: When checked, the macro commands are executed one by one immediately. If not checked, the macro is executed with timers according to the macro command timestamps recorded.
Options > Decimate timers by...: When timeless execution is not checked, this options can be used to divide timers intervals by a number. This means, you can shorten (by providing a number greater than 1) or prolong (by provifing a number lesser than 1) the time recorded in the macro command timestamps.
Options > Invert Incoming & Outgoing...: When checked, "IN_" commands are treated as "OUT" commands and vice-versa.
Note: Execute Incoming/Outgoing Commands options supercede this options. This means, for example, that a macro command of type "IN_" will not be treated as an "OUT" command if Execute Incoming Commands is not checked (but if checked, it will be treated as an "OUT" command regardless of the checked state of Execute Outgoing Commands option). This options is usually used if you execute a macro that was recorded by the PC program by the NetCF program.