winim/utils

This module contains utilities for making Winim development easier.

Imports

windef

Procs

proc `&`[T](x: var T): ptr T {.inline.}
Use & as in C/C++ to get the address of anything.

Converters

converter winimConverterBooleanToBOOL(x: bool): BOOL {....raises: [], tags: [],
    forbids: [].}
Converts between Windows' BOOL/WINBOOL and Nim's Boolean type.
converter winimConverterBOOLToBoolean(x: BOOL): bool {....raises: [], tags: [],
    forbids: [].}
Converts between Windows' BOOL/WINBOOL and Nim's Boolean type.
converter winimConverterVarObjectToPtrObject[T: object](x: var T): ptr T
Pass an object by address if the target is "ptr object". For example:
var msg: MSG
while GetMessage(msg, 0, 0, 0) != 0:
  TranslateMessage(msg)
  DispatchMessage(msg)

Templates

template `&`(x: object): ptr type(x)
Use & to get a pointer for a const object. For example:
# pUk is "ptr IUnknown" for some object
var pDisp: ptr IDispatch
pUk.QueryInterface(&IID_IDispatch, &pDisp)