winapi

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2025 License: MIT Imports: 3 Imported by: 0

README

winapi

Project Banner

license

Overview

winapi is a Go library that implements Win32 API functions, types, and constants that have not yet been implemented in the well-known syscall or sys.windows packages.

License: MIT

Usage

Getting Started

From your shell:

go get "github.com/kamaranl/winapi"

In your code:

//go:build windows

package mywindowsapp

import "github.com/kamaranl/winapi"

Remarks

  • To be used in packages and commands for Windows only (obviously)

TODO

  • Add more tests
  • Add detailed examples

Acknowledgements

Documentation

Rendered for windows/amd64

Overview

Package winapi implements Win32 API functions, types, and constants that have not yet been implemented in syscall or sys.windows.

Index

Constants

View Source
const SFVIDM_REFRESH = 41504

SFVIDM_REFRESH is the id sent to refresh a menu/window.

View Source
const VK_UNASSIGNED = 0xE8

VK_UNASSIGNED is the last unassigned virtual key code.

Variables

This section is empty.

Functions

func AllocConsole

func AllocConsole() error

AllocConsole creates a new console for the calling process. It returns an error if the call fails.

See: https://learn.microsoft.com/en-us/windows/console/allocconsole

func AttachConsole

func AttachConsole(pid ACPId) error

AttachConsole attaches the calling process to the console of another process specified by pid. It returns an error if the call fails.

See: https://learn.microsoft.com/en-us/windows/console/attachconsole

func AttachThreadInput

func AttachThreadInput(idAttach, idAttachTo uint32, attach bool) error

AttachThreadInput attaches or detaches the input processing mechanism of one thread to that of another thread. It returns an error if the call fails.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-attachthreadinput

func BlockInput

func BlockInput(block bool) error

BlockInput blocks keyboard and mouse input events from reaching applications. It returns an error if the call fails.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-blockinput

func BringWindowToTop

func BringWindowToTop(hwnd HWND) error

BringWindowToTop brings the specified window to the top of the Z order (a.k.a. z-index). It returns an error if the call fails.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-bringwindowtotop

func DispatchMessage

func DispatchMessage(msg MSG)

DispatchMessage dispatches a message to a window procedure.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-dispatchmessage

func FreeConsole

func FreeConsole() error

FreeConsole detaches the calling process from its console. It returns an error if the call fails.

See: https://learn.microsoft.com/en-us/windows/console/freeconsole

func GetKeyState

func GetKeyState(virtKey byte) (down bool, toggled bool)

GetKeyState retrieves the status of the specified virtual key by specifying whether the key is up, down, or toggled on/off. It returns a pair of bools where the first bool specifies if the key is currently down and the second bool specifies if the key is currently toggled on.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getkeystate

func GetMessage

func GetMessage(msg MSG, hwnd HWND, msgFilterMin, msgFilterMax MsgId) (uintptr, error)

GetMessage retrieves a message from the calling thread's message queue. It returns -1 with an error if the call fails, or 0 with no error if WM_QUIT is recieved. Otherwise, the return value is nonzero with no error.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getmessage

func GetWindowLongPtrW

func GetWindowLongPtrW(hwnd HWND, index GWL) (uintptr, error)

GetWindowLongPtrW retrieves information about the specified window. It returns 0 with an error if the call fails, or the requested value with no error on success.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowlongptrw

Experimental: GetWindowLongPtrW has not been tested or used internally.

func MapVirtualKeyExW

func MapVirtualKeyExW(code uint32, mapType MapVKType, hkl Handle) (uint32, error)

MapVirtualKeyExW translates a virtual-key code into a scan code or character value, or translates a scan code into a virtual-key code. It translates the codes using the input language and an input locale identifer. It returns 0 with an error if the call fails, or the translated key code with no error on success.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-mapvirtualkeyexw

func MapVirtualKeyW

func MapVirtualKeyW(code uint32, mapType MapVKType) (uint32, error)

MapVirtualKeyW translates a virtual-key code into a scan code or character value, or translates a scan code into a virtual-key code. It returns 0 with an error if the call fails, or the translated key code with no error on success.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-mapvirtualkeyw

Experimental: MapVirtualKeyW has not been tested or used internally.

func PostMessageW

func PostMessageW(hwnd HWND, msg MsgId, wParam, lParam uintptr) error

PostMessageW posts a message in the message queue for the specified window and returns without waiting for the window's thread to process the message. It returns an error if the call fails.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-postmessagew

func PostThreadMessageW

func PostThreadMessageW(idThread uint32, msg MsgId, wParam, lParam uintptr) error

PostThreadMessageW posts a message to the message queue of the specified thread and returns without waiting for the thread to process the message. It returns an error if the call fails.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-postthreadmessagew

func SHChangeNotify

func SHChangeNotify(eventId SHCNEvent, flags SHCNFlags, items ...uintptr)

SHChangeNotify notifies the system of an event, by eventId, that an application has performed.

See: https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shchangenotify

Experimental: SHChangeNotify has not been tested or used internally.

func SendInput

func SendInput[T INPUT_Mi | INPUT_Ki | INPUT_Hi](inputs []T) error

SendInput synthesizes keystrokes, mouse motions, and button clicks through the provided inputs. SendInput can only send a slice of one type at a time. It returns an error if the call fails.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendinput

func SetForegroundWindow

func SetForegroundWindow(hwnd HWND) error

SetForegroundWindow brings the thread that created the specified window into the foreground and activates the window. It returns an error if the call fails.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setforegroundwindow

func SetStdHandle

func SetStdHandle(stdHndl HSTDIO, fd uintptr) error

SetStdHandle sets the handle for a standard device (input, output, or error). It returns an error if the call fails.

See: https://learn.microsoft.com/en-us/windows/console/setstdhandle

func TranslateMessage

func TranslateMessage(msg MSG) error

TranslateMessage translates virtual-key messages into character messages. It returns an error if the call fails.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-translatemessage

func UnhookWinEvent

func UnhookWinEvent(winEventHook Handle) error

UnhookWinEvent removes an event hook function created by a previous call to SetWinEventHook. It returns an error if the call fails.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-unhookwinevent

func VkKeyScanExW

func VkKeyScanExW(ch int16, hkl Handle) (code byte, shift byte, err error)

VkKeyScanExW translates a character to the corresponding virtual-key code and shift state. It translates the character using the input language and physical keyboard layout identifed by the input locale identifier. It returns (0,0) with an error if the call fails, or the translated key code and shift state with no error on success.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-vkkeyscanexw

Types

type ACPId

type ACPId uint32

ACPId represents the id of the process whose console is to be used.

type GWL

type GWL int32

GWL represents a set of zero-based offsets to the value to be retrieved by GetWindowsLong/GetWindowsLongPtr.

Experimental: GWL has not been tested or used internally.

const (
	GWL_EXSTYLE     GWL = -20
	GWLP_HINSTANCE  GWL = -6
	GWLP_HWNDPARENT GWL = -8
	GWLP_ID         GWL = -12
	GWL_STYLE       GWL = -16
	GWLP_USERDATA   GWL = -21
	GWLP_WNDPROC    GWL = -4
)

GWL constants.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowlongw#parameters

type HARDWAREINPUT

type HARDWAREINPUT struct {
	// Msg is the message generated by the input hardware.
	Msg uint32 // (DWORD)

	// ParamL is the low-order word of the lParam for Msg.
	ParamL uint16 // (WORD)

	// ParamH is the high-order word of the lParam for Msg.
	ParamH uint16 // (WORD)
}

A HARDWAREINPUT is a struct that contains information about a simulated message generated by an input device other than a keyboard or mouse.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-hardwareinput

Experimental: HARDWAREINPUT has not been tested or used internally.

type HSTDIO

type HSTDIO uint32

HSTDIO represents a handle for a standard i/o device.

type HWND

type HWND = windows.HWND

func GetParent

func GetParent(hwnd HWND) (HWND, error)

GetParent retrieves a handle to the specified window's parent/owner. It returns 0 with an error if the call fails, or a HWND with no error on success.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getparent

Experimental: GetParent has not been tested or used internally.

func SetFocus

func SetFocus(hwnd HWND) (HWND, error)

SetFocus sets the keyboard focus to the specified window, as long as the window is attached to the calling thread's message queue. It returns 0 with an error if the call fails, or a HWND with no error on success.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setfocus

type Handle

type Handle = windows.Handle

func GetConsoleWindow

func GetConsoleWindow() Handle

GetConsoleWindow retrieves the window handle of the console associated with the calling process. It returns a Handle representing the console window.

See: https://learn.microsoft.com/en-us/windows/console/getconsolewindow

Experimental: GetConsoleWindow has not been tested or used internally.

func SetWinEventHook

func SetWinEventHook(eventMin WEvent, eventMax WEvent, hmodWinEventProc, pfnWinEventProc uintptr, idProcess, idThread uint32, dwFlags WEFlags) (Handle, error)

SetWinEventHook sets an event hook function for a range of events. It returns 0 with an error if the call fails, or a Handle with no error on success.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwineventhook

type IEvent

type IEvent uint32

IEvent represents the type of input event (mouse, keyboard, hardware).

const (
	INPUT_MOUSE IEvent = iota
	INPUT_KEYBOARD
	INPUT_HARDWARE
)

IEvent constants.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-input#members

type INPUT_Hi

type INPUT_Hi struct {
	// Type is the type of input event, INPUT_HARDWARE in this case.
	Type IEvent // (DWORD)

	// Hi is the [HARDWAREINPUT] struct.
	Hi HARDWAREINPUT
	// contains filtered or unexported fields
}

An INPUT_Hi is a struct used by SendInput for synthesizing hardware events, other than those from a keyboard or mouse.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-input#members

func NewHardwareInput

func NewHardwareInput(hi HARDWAREINPUT) (input INPUT_Hi)

NewHardwareInput returns an INPUT_Hi with the provided HARDWAREINPUT.

Experimental: NewHardwareInput has not been tested or used internally.

type INPUT_Ki

type INPUT_Ki struct {
	// Type is the type of input event, INPUT_KEYBOARD in this case.
	Type IEvent // (DWORD)

	// Ki is the [KEYBDINPUT] struct.
	Ki KEYBDINPUT
	// contains filtered or unexported fields
}

An INPUT_Ki is a struct used by SendInput for synthesizing keyboard events.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-input#members

func NewKeybdInput

func NewKeybdInput(ki KEYBDINPUT) (input INPUT_Ki)

NewKeybdInput returns an INPUT_Ki with the provided KEYBDINPUT.

type INPUT_Mi

type INPUT_Mi struct {
	// Type is the type of input event, INPUT_MOUSE in this case.
	Type IEvent // (DWORD)

	// Mi is the [MOUSEINPUT] struct.
	Mi MOUSEINPUT
}

An INPUT_Mi is a struct used by SendInput for synthesizing mouse events.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-input#members

func NewMouseInput

func NewMouseInput(mi MOUSEINPUT) (input INPUT_Mi)

NewMouseInput returns an INPUT_Mi with the provided MOUSEINPUT.

type KEYBDINPUT

type KEYBDINPUT struct {
	// Vk is a virtual key code within the range of 1-254.
	Vk uint16 // (WORD)

	// Scan is a hardware scan code for a key.
	Scan uint16 // (WORD)

	// Flags specifies various aspects of a keystroke.
	Flags KiFlags // (DWORD)

	// Time is the timestamp for the event, in ms.
	Time uint32 // (DWORD)

	// ExtraInfo is an additional value associated with the keystroke.
	ExtraInfo uintptr // (ULONG__PTR)
}

A KEYBDINPUT is a struct that contains informationa about a simulated keyboard event.

See: https://learn.microsoft.com/en-us/windows/desktop/api/winuser/ns-winuser-keybdinput

type KiFlags

type KiFlags uint32

KiFlags represents a set of KEYBDINPUT event flags.

const (
	KEYEVENTF_EXTENDEDKEY KiFlags = 1 << iota
	KEYEVENTF_KEYUP
	KEYEVENTF_UNICODE
	KEYEVENTF_SCANCODE
)

KiFlags constants.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-keybdinput#members

type MOUSEINPUT

type MOUSEINPUT struct {
	// X is the absolute x coordinate of the mouse.
	X int32 // (LONG)

	// Y is the absolute y coordinate of the mouse.
	Y int32 // (LONG)

	// MouseData specifies the amount of wheel movement if Flags contains
	// MOUSEEVENTF_WHEEL.
	MouseData MiData // (DWORD)

	// Flags specifies various aspects of mouse motion and button clicks.
	Flags MiFlags // (DWORD)

	// Time is the timestamp for the event, in ms.
	Time uint32 // (DWORD)

	// ExtraInfo is an additional value associated with the mouse event.
	ExtraInfo uintptr // (ULONG__PTR)
}

A MOUSEINPUT is a struct that contains information about a simulated mouse event.

See: https://learn.microsoft.com/en-us/windows/desktop/api/winuser/ns-winuser-mouseinput

type MSG

type MSG struct {
	// Hwnd is a handle to the window whose procedure receives the message.
	Hwnd HWND

	// Message is the message identifier.
	Message uint32 // (UINT)

	// WParam is additional information about the message.
	WParam uintptr

	// Lparam is additional information about the message.
	LParam uintptr

	// Time is the time at which the message was posted.
	Time uint32 // (DWORD)

	// Pt is the cursor position when the message was posted.
	Pt POINT

	// LPrivate
	LPrivate uint32 // (DWORD)
}

A MSG is a struct that contains message information from a thread's message queue.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-msg

type MapVKType

type MapVKType uint32

MapVKType represents a set of available maps for MapVirtualKey.

const (
	MAPVK_VK_TO_VSC MapVKType = iota
	MAPVK_VSC_TO_VK
	MAPVK_VK_TO_CHAR
	MAPVK_VSC_TO_VK_EX
	MAPVK_VK_TO_VSC_EX
)

MapVKType constants.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-mapvirtualkeyw#parameters

type MiData

type MiData uint32

MiData represents a set of MOUSEINPUT event data.

Experimental: MiData has not been tested or used internally.

type MiFlags

type MiFlags uint32

MiFlags represents a set of MOUSEINPUT event flags.

const (
	MOUSEEVENTF_MOVE MiFlags = 1 << iota
	MOUSEEVENTF_LEFTDOWN
	MOUSEEVENTF_LEFTUP
	MOUSEEVENTF_RIGHTDOWN
	MOUSEEVENTF_RIGHTUP
	MOUSEEVENTF_MIDDLEDOWN
	MOUSEEVENTF_MIDDLEUP
	MOUSEEVENTF_XDOWN
	MOUSEEVENTF_XUP

	MOUSEEVENTF_WHEEL
	MOUSEEVENTF_HWHEEL
	MOUSEEVENTF_MOVE_NOCOALESCE
	MOUSEEVENTF_VIRTUALDESK
	MOUSEEVENTF_ABSOLUTE
)

MiFlags constants.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-mouseinput#members

type MsgId

type MsgId uint32

MsgId represents the id of the message to be sent/posted.

const (
	WM_QUIT    MsgId = 0x0012
	WM_KEYDOWN MsgId = 0x0100
	WM_KEYUP   MsgId = 0x0101
	WM_COMMAND MsgId = 0x0111
)

MsgId constants (partial).

See: https://learn.microsoft.com/en-us/windows/win32/winmsg/about-messages-and-message-queues#system-defined-messages

type POINT

type POINT struct {
	// X is the x-coordinate of the point.
	X int32 // (LONG)

	// Y is the y-coordinate of the point.
	Y int32 // (LONG)
}

A POINT is a struct that defines x- and y- coordinates of a point.

See: https://learn.microsoft.com/en-us/windows/win32/api/windef/ns-windef-point

type SHCNEvent

type SHCNEvent int32

SHCNEvent specifies the SHChangeNotify eventId that has occurred.

Experimental: SHCNEvent has not been tested or used internally.

const (
	SHCNE_ASSOCCHANGED SHCNEvent = 0x08000000
	SHCNE_UPDATEDIR    SHCNEvent = 0x00001000
)

SHCNEvent constants (partial).

See: https://learn.microsoft.com/en-us/windows/console/setstdhandle#parameters

type SHCNFlags

type SHCNFlags uint32

SHCNFlags describe the meaning of the SHChangeNotify items when combined with SHCNF_TYPE.

Experimental: SHCNFlags has not been tested or used internally.

const (
	SHCNF_IDLIST SHCNFlags = 0x0000
	SHCNF_PATH   SHCNFlags = 0x0001
)

SHCNFlags constants (partial).

type WEFlags

type WEFlags uint32

WEFlags specifies the location of the hook function and which events to skip when setting a Windows event hook.

const (
	WINEVENT_OUTOFCONTEXT WEFlags = 1 << iota
	WINEVENT_SKIPOWNTHREAD
	WINEVENT_SKIPOWNPROCESS
	WINEVENT_INCONTEXT
)

WEFlags constants.

See: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwineventhook#WINEVENT_INCONTEXT

type WEvent

type WEvent uint32

WEvent describes events that are generated by the operating system and by server applications.

const (
	EVENT_AIA_START                               WEvent = 0xA000
	EVENT_AIA_END                                 WEvent = 0xAFFF
	EVENT_MIN                                     WEvent = 0x00000001
	EVENT_MAX                                     WEvent = 0x7FFFFFFF
	EVENT_OBJECT_ACCELERATORCHANGE                WEvent = 0x8012
	EVENT_OBJECT_CLOAKED                          WEvent = 0x8017
	EVENT_OBJECT_CONTENTSCROLLED                  WEvent = 0x8015
	EVENT_OBJECT_CREATE                           WEvent = 0x8000
	EVENT_OBJECT_DEFACTIONCHANGE                  WEvent = 0x8011
	EVENT_OBJECT_DESCRIPTIONCHANGE                WEvent = 0x800D
	EVENT_OBJECT_DESTROY                          WEvent = 0x8001
	EVENT_OBJECT_DRAGSTART                        WEvent = 0x8021
	EVENT_OBJECT_DRAGCANCEL                       WEvent = 0x8022
	EVENT_OBJECT_DRAGCOMPLETE                     WEvent = 0x8023
	EVENT_OBJECT_DRAGENTER                        WEvent = 0x8024
	EVENT_OBJECT_DRAGLEAVE                        WEvent = 0x8025
	EVENT_OBJECT_DRAGDROPPED                      WEvent = 0x8026
	EVENT_OBJECT_END                              WEvent = 0x80FF
	EVENT_OBJECT_FOCUS                            WEvent = 0x8005
	EVENT_OBJECT_HELPCHANGE                       WEvent = 0x8010
	EVENT_OBJECT_HIDE                             WEvent = 0x8003
	EVENT_OBJECT_HOSTEDOBJECTSINVALIDATED         WEvent = 0x8020
	EVENT_OBJECT_IME_HIDE                         WEvent = 0x8028
	EVENT_OBJECT_IME_SHOW                         WEvent = 0x8027
	EVENT_OBJECT_IME_CHANGE                       WEvent = 0x8029
	EVENT_OBJECT_INVOKED                          WEvent = 0x8013
	EVENT_OBJECT_LIVEREGIONCHANGED                WEvent = 0x8019
	EVENT_OBJECT_LOCATIONCHANGE                   WEvent = 0x800B
	EVENT_OBJECT_NAMECHANGE                       WEvent = 0x800C
	EVENT_OBJECT_PARENTCHANGE                     WEvent = 0x800F
	EVENT_OBJECT_REORDER                          WEvent = 0x8004
	EVENT_OBJECT_SELECTION                        WEvent = 0x8006
	EVENT_OBJECT_SELECTIONADD                     WEvent = 0x8007
	EVENT_OBJECT_SELECTIONREMOVE                  WEvent = 0x8008
	EVENT_OBJECT_SELECTIONWITHIN                  WEvent = 0x8009
	EVENT_OBJECT_SHOW                             WEvent = 0x8002
	EVENT_OBJECT_STATECHANGE                      WEvent = 0x800A
	EVENT_OBJECT_TEXTEDIT_CONVERSIONTARGETCHANGED WEvent = 0x8030
	EVENT_OBJECT_TEXTSELECTIONCHANGED             WEvent = 0x8014
	EVENT_OBJECT_UNCLOAKED                        WEvent = 0x8018
	EVENT_OBJECT_VALUECHANGE                      WEvent = 0x800E
	EVENT_OEM_DEFINED_START                       WEvent = 0x0101
	EVENT_OEM_DEFINED_END                         WEvent = 0x01FF
	EVENT_SYSTEM_ALERT                            WEvent = 0x0002
	EVENT_SYSTEM_ARRANGMENTPREVIEW                WEvent = 0x8016
	EVENT_SYSTEM_CAPTUREEND                       WEvent = 0x0009
	EVENT_SYSTEM_CAPTURESTART                     WEvent = 0x0008
	EVENT_SYSTEM_CONTEXTHELPEND                   WEvent = 0x000D
	EVENT_SYSTEM_CONTEXTHELPSTART                 WEvent = 0x000C
	EVENT_SYSTEM_DESKTOPSWITCH                    WEvent = 0x0020
	EVENT_SYSTEM_DIALOGEND                        WEvent = 0x0011
	EVENT_SYSTEM_DIALOGSTART                      WEvent = 0x0010
	EVENT_SYSTEM_DRAGDROPEND                      WEvent = 0x000F
	EVENT_SYSTEM_DRAGDROPSTART                    WEvent = 0x000E
	EVENT_SYSTEM_END                              WEvent = 0x00FF
	EVENT_SYSTEM_FOREGROUND                       WEvent = 0x0003
	EVENT_SYSTEM_MENUPOPUPEND                     WEvent = 0x0007
	EVENT_SYSTEM_MENUPOPUPSTART                   WEvent = 0x0006
	EVENT_SYSTEM_MENUEND                          WEvent = 0x0005
	EVENT_SYSTEM_MENUSTART                        WEvent = 0x0004
	EVENT_SYSTEM_MINIMIZEEND                      WEvent = 0x0017
	EVENT_SYSTEM_MINIMIZESTART                    WEvent = 0x0016
	EVENT_SYSTEM_MOVESIZEEND                      WEvent = 0x000B
	EVENT_SYSTEM_MOVESIZESTART                    WEvent = 0x000A
	EVENT_SYSTEM_SCROLLINGEND                     WEvent = 0x0013
	EVENT_SYSTEM_SCROLLINGSTART                   WEvent = 0x0012
	EVENT_SYSTEM_SOUND                            WEvent = 0x0001
	EVENT_SYSTEM_SWITCHEND                        WEvent = 0x0015
	EVENT_SYSTEM_SWITCHSTART                      WEvent = 0x0014
	EVENT_UIA_EVENTID_START                       WEvent = 0x4E00
	EVENT_UIA_EVENTID_END                         WEvent = 0x4EFF
	EVENT_UIA_PROPID_START                        WEvent = 0x7500
	EVENT_UIA_PROPID_END                          WEvent = 0x75FF
)

WEvent constants.

See: https://learn.microsoft.com/en-us/windows/win32/winauto/event-constants

type WS

type WS uintptr

WS represents a set of window styles.

Experimental: WS has not been tested or used internally.

const (
	WS_BORDER             WS = 0x00800000
	WS_CAPTION            WS = (WS_BORDER | WS_DLGFRAME)
	WS_CHILD              WS = 0x40000000
	WS_CHILDWINDOW        WS = WS_CHILD
	WS_CLIPCHILDREN       WS = 0x02000000
	WS_CLIPSIBLINGS       WS = 0x04000000
	WS_DISABLED           WS = 0x08000000
	WS_DLGFRAME           WS = 0x00400000
	WS_GROUP              WS = WS_MINIMIZEBOX
	WS_HSCROLL            WS = 0x00100000
	WS_ICONIC             WS = WS_MINIMIZE
	WS_MAXIMIZE           WS = 0x01000000
	WS_MAXIMIZEBOX        WS = 0x00010000
	WS_MINIMIZE           WS = 0x20000000
	WS_MINIMIZEBOX        WS = 0x00020000
	WS_OVERLAPPED         WS = 0x00000000
	WS_OVERLAPPEDWINDOWWS WS = (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)
	WS_POPUP              WS = 0x80000000
	WS_POPUPWINDOW        WS = (WS_POPUP | WS_BORDER | WS_SYSMENU)
	WS_SIZEBOX            WS = 0x00040000
	WS_SYSMENU            WS = 0x00080000
	WS_TABSTOP            WS = WS_MAXIMIZEBOX
	WS_THICKFRAME         WS = WS_SIZEBOX
	WS_TILED              WS = WS_OVERLAPPED
	WS_TILEDWINDOW        WS = (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)
	WS_VISIBLE            WS = 0x10000000
	WS_VSCROLL            WS = 0x00200000
)

WS constants.

See: https://learn.microsoft.com/en-us/windows/win32/winmsg/window-styles

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL