IVMDisplay::SetDimensions method
[Windows Virtual PC is no longer available for use as of Windows 8. Instead, use the Hyper-V WMI provider (V2).]
Sets the height and width of the virtual machine's (VM's) display, in pixels.
Syntax
HRESULT SetDimensions(
[in] long displayPixelWidth,
[in] long displayPixelHeight
);
Parameters
-
displayPixelWidth [in]
-
The width, in pixels. The value must be between the values of 640 and 2048. If the value is not evenly divisible by 8, then it will be reduced to the next lower multiple of 8.
-
displayPixelHeight [in]
-
The height, in pixels. The value must be between the values of 480 and 1920.
Return value
This method can return one of these values.
Return code/value | Description |
---|---|
|
The operation was successful. |
|
The displayPixelWidth parameter is not evenly divisible by 8 or the displayPixelWidth or displayPixelHeight parameter is outside of the allowed minimum (640x480) or maximum 2048x1920) values. |
|
The resolution change did not finish in a timely manner. |
|
The virtual machine must be running for this operation. |
|
The virtual machine is not valid or is not currently running. |
|
Unable to locate a valid display for the VM. |
|
The version of the integration components installed in the guest operating system does not support this operation. |
|
An unexpected error has occurred. |
Remarks
The minimum size of the virtual machine's display is 640 x 480 pixels. The maximum size is 2048 x 1920. Attempts to set the display size to values outside these limits, or to any width not evenly divisible by 8, will result in an E_INVALIDARG error being returned.
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 |
|
IID |
IID_IVMDisplay is defined as 960895e9-f743-4498-96aa-261f867e7fc5 |