[Home] [Downloads] [Search] [Help/forum]

MUSHclient scripting

Description of MUSHclient world function: world.GetDeviceCaps

Name GetDeviceCaps
Type Method
Summary Gets screen device capabilities
Prototype long GetDeviceCaps(long Index);

View list of data type meanings


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:


Note: Available in version 4.34 onwards.

Lua example
print (GetDeviceCaps (8))  --> 1920  (horizontal width)
Returns The value corresponding to the requested index.
Introduced in version 4.34

See also ...

Function Description
GetSysColor Gets the colour of various windows items
GetSystemMetrics Returns selected system information from Windows

Search for script function

Enter a word or phrase in the box below to narrow the list down to those that match.

The function name, prototype, summary, and description are searched.

Search for:   

Leave blank to show all functions.

Return codes

Many functions return a "code" which indicates the success or otherwise of the function.

You can view a list of the return codes

Function prototypes

The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).

You can view a list of the data types used in function prototypes

View all functions


Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]