This module contains common definitions and procedures used in wAuto.
139 |Types
141 |-
142 |
CursorShape = enum 144 | csUnknow, csHand, csAppStarting, csArrow, csCross, csHelp, csIBeam, csIcon, 145 | csNo, csSize, csSizeAll, csSizeNesw, csSizeNs, csSizeNwse, csSizeWe, 146 | csUpArrow, csWait
147 | - 148 | 149 | Mouse cursor shapes. 150 | 151 | 152 |
Hotkey = tuple[modifiers: int, keyCode: int]
155 | - 156 | 157 | A tuple represents a hotkey combination. modifiers is a bitwise combination of wModShift, wModCtrl, wModAlt, wModWin. keyCode is one of virtual-key codes. This tuple is compatible to hotkey in wNim/wWindow. 158 | 159 | 160 |
MenuItem = object 163 | handle*: HMENU 164 | index*: int 165 | text*: string 166 | id*: int 167 | byPos*: bool 168 |
169 | - 170 | 171 | Represents a menu item. 172 | 173 | 174 |
MouseButton = enum 177 | mbLeft, mbRight, mbMiddle, mbPrimary, mbSecondary
178 | - 179 | 180 | Mouse buttons. 181 | 182 | 183 |
Process = distinct DWORD
186 | - 187 | 188 | The type of a process. 189 | 190 | 191 |
ProcessOption = enum 194 | poStdin, poStdout, poStderr, poStderrMerged, poShow, poHide, poMaximize, 195 | poMinimize, poCreateNewConsole, poLogonProfile, poLogonNetwork
196 | -
197 |
198 | Options to create child process.
211 | 212 | 199 |Options Description 200 |poStdin Provide a handle to the child's STDIN stream 201 |poStdout Provide a handle to the child's STDOUT stream 202 |poStderr Provide a handle to the child's STDERR stream 203 |poStderrMerged Provides the same handle for STDOUT and STDERR. 204 |poShow Shown window. 205 |poHide Hidden window. 206 |poMaximize Maximized window. 207 |poMinimize Minimized window. 208 |poCreateNewConsole The child console process should be created with it's own window instead of using the parent's window. 209 |poLogonProfile Interactive logon with profile (for RunAs). 210 |poLogonNetwork Network credentials only (for RunAs).
213 | ProcessPriority = enum 216 | ppError, ppIdle, ppBelowNormal, ppNormal, ppAboveNormal, ppHigh, ppRealtime
217 | - 218 | 219 | Priority of process. 220 | 221 | 222 |
ProcessStats = object 225 | readOperationCount*: ULONGLONG 226 | writeOperationCount*: ULONGLONG 227 | otherOperationCount*: ULONGLONG 228 | readTransferCount*: ULONGLONG 229 | writeTransferCount*: ULONGLONG 230 | otherTransferCount*: ULONGLONG 231 | pageFaultCount*: DWORD 232 | peakWorkingSetSize*: SIZE_T 233 | workingSetSize*: SIZE_T 234 | quotaPeakPagedPoolUsage*: SIZE_T 235 | quotaPagedPoolUsage*: SIZE_T 236 | quotaPeakNonPagedPoolUsage*: SIZE_T 237 | quotaNonPagedPoolUsage*: SIZE_T 238 | pagefileUsage*: SIZE_T 239 | peakPagefileUsage*: SIZE_T 240 | gdiObjects*: DWORD 241 | userObjects*: DWORD 242 |
243 | - 244 | 245 | 246 | 247 | 248 |
RegData = object 251 | case kind*: RegKind 252 | of rkRegError: 253 | nil 254 | of rkRegDword, rkRegDwordBigEndian: 255 | dword*: DWORD 256 | of rkRegQword: 257 | qword*: QWORD 258 | else: 259 | data*: string 260 |
261 | - 262 | 263 | The kind and data for the specified value in registry. 264 | 265 | 266 |
RegKind = enum 269 | rkRegNone = (0, "REG_NONE"), rkRegSz = (1, "REG_SZ"), 270 | rkRegExpandSz = (2, "REG_EXPAND_SZ"), rkRegBinary = (3, "REG_BINARY"), 271 | rkRegDword = (4, "REG_DWORD"), 272 | rkRegDwordBigEndian = (5, "REG_DWORD_BIG_ENDIAN"), 273 | rkRegLink = (6, "REG_LINK"), rkRegMultiSz = (7, "REG_MULTI_SZ"), 274 | rkRegResourceList = (8, "REG_RESOURCE_LIST"), 275 | rkRegFullResourceDescriptor = (9, "REG_FULL_RESOURCE_DESCRIPTOR"), 276 | rkRegResourceRequirementsList = (10, "REG_RESOURCE_REQUIREMENTS_LIST"), 277 | rkRegQword = (11, "REG_QWORD"), rkRegError = (12, "REG_ERROR")
278 | - 279 | 280 | The kinds of data type in registry. 281 | 282 | 283 |
Window = distinct HWND
286 | - 287 | 288 | The type of a window. 289 | 290 | 291 |
Consts
297 |-
298 |
InvalidProcess = -1'i32
300 | - 301 | 302 | 303 | 304 | 305 |
InvalidWindow = 0
308 | - 309 | 310 | 311 | 312 | 313 |
ppLow = ppIdle
316 | - 317 | 318 | 319 | 320 | 321 |
Procs
327 |-
328 |
proc opt(key: string): int {....raises: [], tags: [], forbids: [].}
331 | - 332 | 333 | Gets the current setting value. 334 | 335 | 336 |
proc opt(key: string; value: int): int {.discardable, ...raises: [], tags: [], 339 | forbids: [].}
340 | -
341 |
342 | Change the global setting for window, mouse, and keyboard module. All options are case-insensitive and in milliseconds.
351 | 352 | 343 |Options Description 344 |MouseClickDelay Alters the length of the brief pause in between mouse clicks. 345 |MouseClickDownDelay Alters the length a click is held down before release. 346 |MouseClickDragDelay Alters the length of the brief pause at the start and end of a mouse drag operation. 347 |SendKeyDelay Alters the length of the brief pause in between sent keystrokes. 348 |SendKeyDownDelay Alters the length of time a key is held down before being released during a keystroke. 349 |WinDelay Alters how long to pause after a successful window-related operation. 350 |WinWaitDelay Alters how long to pause during window wait operation.
353 |