Redigera

Dela via


IVMMouse::SetButton method

[Windows Virtual PC is no longer available for use as of Windows 8. Instead, use the Hyper-V WMI provider (V2).]

Sets the current state (up or down) of the specified mouse button.

Syntax

HRESULT SetButton(
  [in] VMMouseButton buttonIndex,
  [in] VARIANT_BOOL  down
);

Parameters

buttonIndex [in]

The button index. For a list of values, see VMMouseButton.

down [in]

The new button state. Use TRUE if the button state is to be set to down, and FALSE if it is to be set to up.

Return value

This method can return one of these values.

Return code/value Description
S_OK
0
The operation was successful.
E_INVALIDARG
0x80000003
The buttonIndex parameter is not valid.
VM_E_VM_NOT_RUNNING
0xA0040206
The virtual machine to which this mouse device is attached is not currently running.
VM_E_MOUSE_NOT_ACTIVE
0xA0040800
The operation could not be completed because the mouse device is not powered up, or it is not currently active in the virtual machine.
DISP_E_EXCEPTION
0x80020009
An unexpected error has occurred.

Requirements

Requirement Value
Minimum supported client
Windows 7 [desktop apps only]
Minimum supported server
None supported
End of client support
Windows 7
Product
Windows Virtual PC
Header
VPCCOMInterfaces.h
IID
IID_IVMmouse is defined as ac903f6d-6346-4f29-8875-5d511a13895e

See also

IVMMouse