Collapse All
Parallels C API Reference Guide
PrlVm_RegEventHandler Function
PrlApi.h PHT_VIRTUAL_MACHINE

Registers an event handler (callback function) with the virtual machine.

Syntax
PRL_RESULT PrlVm_RegEventHandler(
    PRL_HANDLE hObj, 
    PRL_EVENT_HANDLER_PTR handler, 
    PRL_VOID_PTR userData
);
File
Parameters

hObj
handler
A pointer to the callback function that will handle events.
userData
A pointer to a user data that will be passed to the callback function.
Returns

PRL_RESULT . Possible values:

PRL_ERR_INVALID_ARG - invalid handle or null pointer was passed.

PRL_ERR_SUCCESS - function completed successfully.

Remarks

To use the callback functionality, you first have to implement a callback function. The callback function must have a specific signature (see PRL_METHOD_PTR for the prototype). After you register an event handler with a virtual machine, the callback function will be called every time an event is generated in the machine.

You can also register an event handler with a Parallels Service (instead of a particular virtual machine) using the PrlSrv_RegEventHandler function. If you register the event handler with the Parallels Service, you will be able to receive events from all of the virtual machines registered with that Parallels Service. For more information on events and asynchronous functions, see the Parallels Virtualization SDK Programmer's Guide.

Links
Copyright © 1999-2011 Parallels Holdings, Ltd. and its affiliates. All rights reserved.
What do you think about this topic? Send feedback!