OLESTATUS OleActivate(lpObject, verb, fShow, fTakeFocus, hwnd, lpBounds) | |||||
LPOLEOBJECT lpObject; | /* pointer to object to activate | */ | |||
UINT verb; | /* operation to perform | */ | |||
BOOL fShow; | /* whether or not window is shown | */ | |||
BOOL fTakeFocus; | /* whether server gets focus | */ | |||
HWND hwnd; | /* window handle of container | */ | |||
CONT RECT FAR *lpBounds; | /* bounding rectangle for object display | */ |
The OleActivate function opens an object for an operation. Typically, the object is edited or played.
lpObject
Points to the object to open.
verb
Specifies which operation to perform. Zero specifies the primary verb, one specifies the secondary verb, and so on.
fShow
Specifies whether to show the window. This value is TRUE to show the window and FALSE otherwise.
fTakeFocus
Specifies whether the server should take the focus. This parameter is relevant only if the fShow parameter is TRUE.
hwnd
Identifies the window of the document containing the object. This parameter can be NULL.
lpBounds
Points to a RECT structure containing the coordinates of the bounding rectangle in which the container displays the object. This parameter may be NULL. The mapping mode of the device context determines the units for these coordinates.
The return value is OLE_OK if the function is successful. Otherwise, it is an error value, which can be OLE_BUSY, OLE_ERROR_OBJECT, or OLE_WAIT_FOR_RELEASE.
Typically, a server is launched in a separate window and editing then occurs asynchronously. The client is notified of changes to the object through the callback function.
A client application might set the fShow parameter to FALSE if a server needed to remain active without being visible on the display. (In this case, the application would also use the OleSetData function.)
Client applications typically specify the primary verb when the user double-clicks an object. The server can take any action in response to the specified verbs. If the server supports only one action, it takes that action no matter what value is passed in the verb parameter.
The hwnd and lpBounds parameters will be used to help determine the placement of the server's editing window in future releases of the OLE protocol.
OleQueryOpen, OleSetData