With this functionality, you can programmatically connect to a remote virtual machine and run its applications as if you were sitting at the virtual machine's console. The typical uses of the Remote Desktop Access functionality are:
- Creating automation scripts for unattended operating system and other software installations.
- Creating your own remote desktop applications with graphical user interfaces.
There are four groups of functions comprising the Remote Desktop Access API :
- Primary display capture. These functions allow to capture a region or an entire screen of the remote virtual machine. In scripts, you can take a snapshot of a particular screen in advance and then compare it to the screen captured at runtime. If comparison operation determines that you've got the screen of interest, you can interact with it by sending mouse or keyboard commands (pressing buttons, making selections, etc.). In a GUI application, you can constantly capture screens (or screen regions) and display them to the user of your application, thus providing a real-time remote desktop access to a virtual machine.
- Secondary display capture. This group of functions is almost identical to the Primary Display Capture group with the exception that it operates on a secondary display(s) if one is installed in a virtual machine.
- Mouse control. These functions provide control over the mouse in a virtual machine. You can change the position of the mouse pointer, press and release mouse buttons, and use a scroll wheel. In GUI applications, you can capture mouse events in the host OS where the application is running and then transmit those events to the virtual machine. In scripts, you can move a mouse pointer to the coordinates you know in advance (coordinates of a button, an edit control, etc.) and perform an action.
- Keyboard control. These functions simply send a key/action code combination to the virtual machine. In scripts, you can use these functions to interact with controls on a window opened inside a virtual machine (pressing buttons, selecting options, etc.). In a typical GUI application, essential visual controls usually have keyboard shortcuts (accelerator keys) assigned to them. If a control doesn't have a shortcut, then you will have to use mouse control functions to position a mouse pointer over the control to select it.
Every remote desktop access session must begin with PrlDevDisplay_ConnectToVm function call and end with the PrlDevDisplay_DisconnectFromVm call.
For more information and code samples, please see Virtuozzo Virtualization SDK Programmer's Guide.