world.GetDeviceCaps

MUSHclient script function (Method) — introduced in version 4.34

Gets screen device capabilities

Prototype

long GetDeviceCaps(long Index);

Data type meanings

Description

This asks Windows for the capability of your output screen. The index specifies which attribute you are interested in, and it returns a number corresponding to that. Some useful indices are as follows:

0 : Device driver version
2 : Device classification
4 : Horizontal size in millimeters
6 : Vertical size in millimeters
8 : Horizontal width in pixels
10 : Vertical height in pixels
12 : Number of bits per pixel
14 : Number of planes
16 : Number of brushes the device has
18 : Number of pens the device has
20 : Number of markers the device has
22 : Number of fonts the device has
24 : Number of colors the device supports
26 : Size required for device descriptor
28 : Curve capabilities
30 : Line capabilities
32 : Polygonal capabilities
34 : Text capabilities
36 : Clipping capabilities
38 : Bitblt capabilities
40 : Length of the X leg
42 : Length of the Y leg
44 : Length of the hypotenuse
45 : Shading and blending caps
88 : Logical pixels/inch in X
90 : Logical pixels/inch in Y
104 : Number of entries in physical palette
106 : Number of reserved entries in palette
108 : Actual color resolution
116 : Current vertical refresh rate of the display device (for displays only) in Hz
117 : Horizontal width of entire desktop in pixels
118 : Vertical height of entire desktop in pixels
119 : Preferred blt alignment

For more information, see:

http://www.gammon.com.au/mushclient/mw_other.htm

Lua example

print (GetDeviceCaps (8))  --> 1920  (horizontal width)

Return value

The value corresponding to the requested index.

Related topic

MiniWindows

See also

FunctionDescription
GetSysColorGets the colour of various windows items
GetSystemMetricsReturns selected system information from Windows