BOOL GetSize( |
|
LPSIZE lpSize |
|
); |
BOOL GetSize( |
|
LPINT lpnWidth, |
|
|
LPINT lpnHeight |
|
); |
The GetSize returns the size of the virtual display in
columns and rows.
Parameters
- lpRect
- Pointer to a SIZE structure which will contain the size of the
virtual display.
- lpnWidth
- Pointer to an integer which will contain the number of columns
in the virtual display when the method returns. If a NULL pointer
is passed as the argument, this value is ignored.
- lpnHeight
- Pointer to an integer which will contain the number of rows in
the virtual display when the method returns. If a NULL pointer is
passed as the argument, this value is ignored.
Return Value
If the method succeeds, the return value is non-zero. If the
method fails, it returns zero.
Remarks
The GetSize method returns the number of columns and rows
in the virtual display. To convert this to pixels, use the
GetCellSize method to determine the size of a character cell
and multiply that by the number of columns and/or rows.
Example
// Calculate the size of the client area in pixels
// for the virtual display
INT cxCell = 0, cyCell = 0;
INT cxDisplay = 0, cyDisplay = 0;
if (pDisplay->GetCellSize(&cxCell, &cyCell))
{
INT nColumns, nRows;
if (pDisplay->GetSize(&nColumns, &nRows))
{
cxDisplay = nColumns * cxCell;
cyDisplay = nRows * cyCell;
}
}
Requirements
Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header File: cstools10.h
Import Library: csnvtv10.lib
See Also
GetCellSize,
GetDisplayInfo,
GetRect
|