IVMKeyboard::IsPressed method

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

Determines whether the specified key is down.

Syntax

HRESULT IsPressed(
  [in]          BSTR         key,
  [out, retval] VARIANT_BOOL *pressed
);

Parameters

key [in]

The key code for the key whose state is to be queried.

pressed [out, retval]

TRUE if the key is currently pressed down, FALSE otherwise.

Return value

This method can return one of these values.

Return code/value Description
S_OK
0
The operation was successful.
E_POINTER
0x80004003
A parameter is NULL.
E_INVALIDARG
0x80000003
The specified string is empty, or contains an invalid key code.
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_IVMKeyboard is defined as 00695f2e-c5ad-4d6e-b1ab-336ed121f8c4

See also

IVMKeyboard