wUtils

wNim's utilities and convenience functions.

Consts

wSysBorderX = 5
Width of single border.
wSysBorderY = 6
Height of single border.
wSysCursorX = 13
Width of cursor.
wSysCursorY = 14
Height of cursor.
wSysDclickX = 36
Width in pixels of rectangle within which two successive mouse clicks must fall to generate a double-click.
wSysDclickY = 37
Height in pixels of rectangle within which two successive mouse clicks must fall to generate a double-click.
wSysDragX = 68
Width in pixels of a rectangle centered on a drag point to allow for limited movement of the mouse pointer before a drag operation begins.
wSysDragY = 69
Height in pixels of a rectangle centered on a drag point to allow for limited movement of the mouse pointer before a drag operation begins.
wSysEdgeX = 45
Width of a 3D border, in pixels.
wSysEdgeY = 46
Height of a 3D border, in pixels.
wSysVThumbY = 9
Height of vertical scrollbar thumb.
wSysHThumbX = 10
Width of horizontal scrollbar thumb.
wSysIconX = 11
The default width of an icon.
wSysIconY = 12
The default height of an icon.
wSysIconSpacingX = 38
Width of a grid cell for items in large icon view, in pixels. Each item fits into a rectangle of this size when arranged.
wSysIconSpacingY = 39
Height of a grid cell for items in large icon view, in pixels. Each item fits into a rectangle of this size when arranged.
wSysWindowMinX = 28
Minimum width of a window.
wSysWindowMinY = 29
Minimum height of a window.
wSysScreenX = 0
Width of the screen in pixels.
wSysScreenY = 1
Height of the screen in pixels.
wSysFrameSizeX = 32
Width of the window frame for a wResizeBorder window.
wSysFrameSizeY = 33
Height of the window frame for a wResizeBorder window.
wSysSmallIconX = 49
Recommended width of a small icon (in window captions, and small icon view).
wSysSmallIconY = 50
Recommended height of a small icon (in window captions, and small icon view).
wSysHScrollY = 3
The height of a horizontal scroll bar, in pixels.
wSysVScrollX = 2
The width of a vertical scroll bar, in pixels.
wSysHScrollArrowX = 21
The width of the arrow bitmap on a horizontal scroll bar, in pixels.
wSysVScrollArrowY = 20
The height of the arrow bitmap on a vertical scroll bar, in pixels.
wSysCaptionY = 4
Height of normal caption area.
wSysMenuY = 15
Height of single-line menu bar.
wSysNetworkPresent = 63
1 if there is a network present, 0 otherwise.
wSysPenWindowsPresent = 41
1 if PenWindows is installed, 0 otherwise.
wSysShowSounds = 70
Non-zero if the user requires an application to present information visually in situations where it would otherwise present the information only in audible form; zero otherwise.
wSysSwapButtons = 23
Non-zero if the meanings of the left and right mouse buttons are swapped; zero otherwise.

Procs

proc wGetMousePosition(): wPoint {...}{.raises: [], tags: [].}
Returns the mouse position in screen coordinates.
proc wSetMousePosition(pos: wPoint) {...}{.raises: [], tags: [].}
Sets the mouse position
proc wGetKeyState(key: int): bool {...}{.raises: [], tags: [].}
For normal keys, returns true if the specified key is currently down. For togglable keys (Caps Lock, Num Lock and Scroll Lock), returns true if the key is toggled such that its LED indicator is lit.
proc wFindWindowAtPoint(pos: wPoint = wDefaultPoint): wWindow {...}{.raises: [], tags: [].}
Find the deepest window at the given mouse position in screen coordinates, returning the window if found, or nil if not.
proc wGetFocusWindow(): wWindow {...}{.raises: [], tags: [].}
Gets the currently focus window.
proc wGetScreenSize(): wSize {...}{.raises: [], tags: [].}
Gets the screen size.
proc wSetClipboard(dataObject: wDataObject): bool {...}{.discardable,
    raises: [NilAccessError], tags: [].}
Places a specific data object onto the clipboard.
proc wGetClipboard(): wDataObject {...}{.raises: [Exception], tags: [RootEffect].}
Retrieves a data object that you can use to access the contents of the clipboard.
proc wClearClipboard() {...}{.raises: [], tags: [].}
Clears the clipboard.
proc wFlushClipboard() {...}{.raises: [], tags: [].}
Flushes the clipboard: this means that the data which is currently on clipboard will stay available even after the application exits.
proc wGetSystemMetric(index: int): int {...}{.inline, raises: [], tags: [].}
Returns the value of a system metric. Possible value for index listed in consts.
proc wGetDefaultPrinter(): string {...}{.raises: [], tags: [].}
Returns the printer name of the default printer for the current user.
proc wSetDefaultPrinter(device: string) {...}{.inline, raises: [], tags: [].}
Sets the printer name of the default printer for the current user
proc wGetPrinters(): seq[string] {...}{.raises: [], tags: [].}
Returns available printers.
proc wSetSysemDpiAware(): bool {...}{.discardable, raises: [], tags: [].}
Sets the default DPI awareness to system aware (Windows Vista later). Return true if the function succeeds.
proc wSetPerMonitorDpiAware(): bool {...}{.discardable, raises: [Exception],
                                   tags: [RootEffect].}
Sets the default DPI awareness to per monitor aware v2 (Windows 10 version 1607 later), or per monitor aware (Windows 8.1 later). Return true if the function succeeds.
proc wGetWinVersion(): float {...}{.raises: [Exception], tags: [RootEffect].}
Get Windows release version number.
Windows VersionRelease Version
Windows 1010.0
Windows 8.16.3
Windows 86.2
Windows 76.1
Windows Vista6.0
Windows XP5.1