DesktopWidth ( )

Parameters

None.

Description

Returns the current width of the primary Windows desktop, in pixels.

DesktopWidth does not require an open graphics display and queries the desktop each time it is called. Calling Graphics or Graphics3D with no dimensions uses this value for the display width.

See also: DesktopHeight, GraphicsWidth, Graphics.

Example

; DesktopWidth Example
; --------------------

desktop_w=DesktopWidth()
desktop_h=DesktopHeight()

; With no dimensions, Graphics uses the desktop size
Graphics
SetBuffer BackBuffer()

While Not KeyDown(1)

    Cls

    Text 0,0,"Esc: exit"
    Text 0,20,"DesktopWidth() = "+desktop_w+"   DesktopHeight() = "+desktop_h
    Text 0,40,"Graphics size: "+GraphicsWidth()+" x "+GraphicsHeight()

    Flip

Wend

End

Index