win32

package
v2.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	WM_APP                    = 32768
	WM_ACTIVATE               = 6
	WM_ACTIVATEAPP            = 28
	WM_AFXFIRST               = 864
	WM_AFXLAST                = 895
	WM_ASKCBFORMATNAME        = 780
	WM_CANCELJOURNAL          = 75
	WM_CANCELMODE             = 31
	WM_CAPTURECHANGED         = 533
	WM_CHANGECBCHAIN          = 781
	WM_CHAR                   = 258
	WM_CHARTOITEM             = 47
	WM_CHILDACTIVATE          = 34
	WM_CLEAR                  = 771
	WM_CLOSE                  = 16
	WM_COMMAND                = 273
	WM_COMMNOTIFY             = 68 /* OBSOLETE */
	WM_COMPACTING             = 65
	WM_COMPAREITEM            = 57
	WM_CONTEXTMENU            = 123
	WM_COPY                   = 769
	WM_COPYDATA               = 74
	WM_CREATE                 = 1
	WM_CTLCOLORBTN            = 309
	WM_CTLCOLORDLG            = 310
	WM_CTLCOLOREDIT           = 307
	WM_CTLCOLORLISTBOX        = 308
	WM_CTLCOLORMSGBOX         = 306
	WM_CTLCOLORSCROLLBAR      = 311
	WM_CTLCOLORSTATIC         = 312
	WM_CUT                    = 768
	WM_DEADCHAR               = 259
	WM_DELETEITEM             = 45
	WM_DESTROY                = 2
	WM_DESTROYCLIPBOARD       = 775
	WM_DEVICECHANGE           = 537
	WM_DEVMODECHANGE          = 27
	WM_DISPLAYCHANGE          = 126
	WM_DRAWCLIPBOARD          = 776
	WM_DRAWITEM               = 43
	WM_DROPFILES              = 563
	WM_ENABLE                 = 10
	WM_ENDSESSION             = 22
	WM_ENTERIDLE              = 289
	WM_ENTERMENULOOP          = 529
	WM_ENTERSIZEMOVE          = 561
	WM_ERASEBKGND             = 20
	WM_EXITMENULOOP           = 530
	WM_EXITSIZEMOVE           = 562
	WM_FONTCHANGE             = 29
	WM_GETDLGCODE             = 135
	WM_GETFONT                = 49
	WM_GETHOTKEY              = 51
	WM_GETICON                = 127
	WM_GETMINMAXINFO          = 36
	WM_GETTEXT                = 13
	WM_GETTEXTLENGTH          = 14
	WM_HANDHELDFIRST          = 856
	WM_HANDHELDLAST           = 863
	WM_HELP                   = 83
	WM_HOTKEY                 = 786
	WM_HSCROLL                = 276
	WM_HSCROLLCLIPBOARD       = 782
	WM_ICONERASEBKGND         = 39
	WM_INITDIALOG             = 272
	WM_INITMENU               = 278
	WM_INITMENUPOPUP          = 279
	WM_INPUT                  = 0x00FF
	WM_INPUTLANGCHANGE        = 81
	WM_INPUTLANGCHANGEREQUEST = 80
	WM_KEYDOWN                = 256
	WM_KEYUP                  = 257
	WM_KILLFOCUS              = 8
	WM_MDIACTIVATE            = 546
	WM_MDICASCADE             = 551
	WM_MDICREATE              = 544
	WM_MDIDESTROY             = 545
	WM_MDIGETACTIVE           = 553
	WM_MDIICONARRANGE         = 552
	WM_MDIMAXIMIZE            = 549
	WM_MDINEXT                = 548
	WM_MDIREFRESHMENU         = 564
	WM_MDIRESTORE             = 547
	WM_MDISETMENU             = 560
	WM_MDITILE                = 550
	WM_MEASUREITEM            = 44
	WM_GETOBJECT              = 0x003D
	WM_CHANGEUISTATE          = 0x0127
	WM_UPDATEUISTATE          = 0x0128
	WM_QUERYUISTATE           = 0x0129
	WM_UNINITMENUPOPUP        = 0x0125
	WM_MENURBUTTONUP          = 290
	WM_MENUCOMMAND            = 0x0126
	WM_MENUGETOBJECT          = 0x0124
	WM_MENUDRAG               = 0x0123
	WM_APPCOMMAND             = 0x0319
	WM_MENUCHAR               = 288
	WM_MENUSELECT             = 287
	WM_MOVE                   = 3
	WM_MOVING                 = 534
	WM_NCACTIVATE             = 134
	WM_NCCALCSIZE             = 131
	WM_NCCREATE               = 129
	WM_NCDESTROY              = 130
	WM_NCHITTEST              = 132
	WM_NCLBUTTONDBLCLK        = 163
	WM_NCLBUTTONDOWN          = 161
	WM_NCLBUTTONUP            = 162
	WM_NCMBUTTONDBLCLK        = 169
	WM_NCMBUTTONDOWN          = 167
	WM_NCMBUTTONUP            = 168
	WM_NCXBUTTONDOWN          = 171
	WM_NCXBUTTONUP            = 172
	WM_NCXBUTTONDBLCLK        = 173
	WM_NCMOUSEHOVER           = 0x02A0
	WM_NCMOUSELEAVE           = 0x02A2
	WM_NCMOUSEMOVE            = 160
	WM_NCPAINT                = 133
	WM_NCRBUTTONDBLCLK        = 166
	WM_NCRBUTTONDOWN          = 164
	WM_NCRBUTTONUP            = 165
	WM_NEXTDLGCTL             = 40
	WM_NEXTMENU               = 531
	WM_NOTIFY                 = 78
	WM_NOTIFYFORMAT           = 85
	WM_NULL                   = 0
	WM_PAINT                  = 15
	WM_PAINTCLIPBOARD         = 777
	WM_PAINTICON              = 38
	WM_PALETTECHANGED         = 785
	WM_PALETTEISCHANGING      = 784
	WM_PARENTNOTIFY           = 528
	WM_PASTE                  = 770
	WM_PENWINFIRST            = 896
	WM_PENWINLAST             = 911
	WM_POWER                  = 72
	WM_PRINT                  = 791
	WM_PRINTCLIENT            = 792
	WM_QUERYDRAGICON          = 55
	WM_QUERYENDSESSION        = 17
	WM_QUERYNEWPALETTE        = 783
	WM_QUERYOPEN              = 19
	WM_QUEUESYNC              = 35
	WM_QUIT                   = 18
	WM_RENDERALLFORMATS       = 774
	WM_RENDERFORMAT           = 773
	WM_SETCURSOR              = 32
	WM_SETFOCUS               = 7
	WM_SETFONT                = 48
	WM_SETHOTKEY              = 50
	WM_SETICON                = 128
	WM_SETREDRAW              = 11
	WM_SETTEXT                = 12
	WM_SETTINGCHANGE          = 26
	WM_SHOWWINDOW             = 24
	WM_SIZE                   = 5
	WM_SIZECLIPBOARD          = 779
	WM_SIZING                 = 532
	WM_SPOOLERSTATUS          = 42
	WM_STYLECHANGED           = 125
	WM_STYLECHANGING          = 124
	WM_SYSCHAR                = 262
	WM_SYSCOLORCHANGE         = 21
	WM_SYSCOMMAND             = 274
	WM_SYSDEADCHAR            = 263
	WM_SYSKEYDOWN             = 260
	WM_SYSKEYUP               = 261
	WM_TCARD                  = 82
	WM_THEMECHANGED           = 794
	WM_TIMECHANGE             = 30
	WM_TIMER                  = 275
	WM_UNDO                   = 772
	WM_USER                   = 1024
	WM_USERCHANGED            = 84
	WM_VKEYTOITEM             = 46
	WM_VSCROLL                = 277
	WM_VSCROLLCLIPBOARD       = 778
	WM_WINDOWPOSCHANGED       = 71
	WM_WINDOWPOSCHANGING      = 70
	WM_WININICHANGE           = 26
	WM_KEYFIRST               = 256
	WM_KEYLAST                = 264
	WM_SYNCPAINT              = 136
	WM_MOUSEACTIVATE          = 33
	WM_MOUSEMOVE              = 512
	WM_LBUTTONDOWN            = 513
	WM_LBUTTONUP              = 514
	WM_LBUTTONDBLCLK          = 515
	WM_RBUTTONDOWN            = 516
	WM_RBUTTONUP              = 517
	WM_RBUTTONDBLCLK          = 518
	WM_MBUTTONDOWN            = 519
	WM_MBUTTONUP              = 520
	WM_MBUTTONDBLCLK          = 521
	WM_MOUSEWHEEL             = 522
	WM_MOUSEFIRST             = 512
	WM_XBUTTONDOWN            = 523
	WM_XBUTTONUP              = 524
	WM_XBUTTONDBLCLK          = 525
	WM_MOUSELAST              = 525
	WM_MOUSEHOVER             = 0x2A1
	WM_MOUSELEAVE             = 0x2A3
	WM_CLIPBOARDUPDATE        = 0x031D

	WS_EX_APPWINDOW           = 0x00040000
	WS_OVERLAPPEDWINDOW       = 0x00000000 | 0x00C00000 | 0x00080000 | 0x00040000 | 0x00020000 | 0x00010000
	WS_EX_NOREDIRECTIONBITMAP = 0x00200000
	CW_USEDEFAULT             = ^0x7fffffff

	NIM_ADD        = 0x00000000
	NIM_MODIFY     = 0x00000001
	NIM_DELETE     = 0x00000002
	NIM_SETVERSION = 0x00000004

	NIF_MESSAGE = 0x00000001
	NIF_ICON    = 0x00000002
	NIF_TIP     = 0x00000004
	NIF_STATE   = 0x00000008
	NIF_INFO    = 0x00000010

	NIS_HIDDEN = 0x00000001

	NIIF_NONE               = 0x00000000
	NIIF_INFO               = 0x00000001
	NIIF_WARNING            = 0x00000002
	NIIF_ERROR              = 0x00000003
	NIIF_USER               = 0x00000004
	NIIF_NOSOUND            = 0x00000010
	NIIF_LARGE_ICON         = 0x00000020
	NIIF_RESPECT_QUIET_TIME = 0x00000080
	NIIF_ICON_MASK          = 0x0000000F

	IMAGE_BITMAP    = 0
	IMAGE_ICON      = 1
	LR_LOADFROMFILE = 0x00000010
	LR_DEFAULTSIZE  = 0x00000040

	IDC_ARROW     = 32512
	COLOR_WINDOW  = 5
	COLOR_BTNFACE = 15

	GWLP_USERDATA       = -21
	WS_CLIPSIBLINGS     = 0x04000000
	WS_EX_CONTROLPARENT = 0x00010000

	HWND_MESSAGE       = ^HWND(2)
	NOTIFYICON_VERSION = 4

	IDI_APPLICATION = 32512

	MenuItemMsgID       = WM_APP + 1024
	NotifyIconMessageId = WM_APP + iota

	MF_STRING       = 0x00000000
	MF_ENABLED      = 0x00000000
	MF_GRAYED       = 0x00000001
	MF_DISABLED     = 0x00000002
	MF_SEPARATOR    = 0x00000800
	MF_UNCHECKED    = 0x00000000
	MF_CHECKED      = 0x00000008
	MF_POPUP        = 0x00000010
	MF_MENUBARBREAK = 0x00000020
	MF_BYCOMMAND    = 0x00000000

	TPM_LEFTALIGN = 0x0000

	CS_VREDRAW = 0x0001
	CS_HREDRAW = 0x0002
)
View Source
const (
	VK_LBUTTON             = 1
	VK_RBUTTON             = 2
	VK_CANCEL              = 3
	VK_MBUTTON             = 4
	VK_XBUTTON1            = 5
	VK_XBUTTON2            = 6
	VK_BACK                = 8
	VK_TAB                 = 9
	VK_CLEAR               = 12
	VK_RETURN              = 13
	VK_SHIFT               = 16
	VK_CONTROL             = 17
	VK_MENU                = 18
	VK_PAUSE               = 19
	VK_CAPITAL             = 20
	VK_KANA                = 0x15
	VK_HANGEUL             = 0x15
	VK_HANGUL              = 0x15
	VK_JUNJA               = 0x17
	VK_FINAL               = 0x18
	VK_HANJA               = 0x19
	VK_KANJI               = 0x19
	VK_ESCAPE              = 0x1B
	VK_CONVERT             = 0x1C
	VK_NONCONVERT          = 0x1D
	VK_ACCEPT              = 0x1E
	VK_MODECHANGE          = 0x1F
	VK_SPACE               = 32
	VK_PRIOR               = 33
	VK_NEXT                = 34
	VK_END                 = 35
	VK_HOME                = 36
	VK_LEFT                = 37
	VK_UP                  = 38
	VK_RIGHT               = 39
	VK_DOWN                = 40
	VK_SELECT              = 41
	VK_PRINT               = 42
	VK_EXECUTE             = 43
	VK_SNAPSHOT            = 44
	VK_INSERT              = 45
	VK_DELETE              = 46
	VK_HELP                = 47
	VK_LWIN                = 0x5B
	VK_RWIN                = 0x5C
	VK_APPS                = 0x5D
	VK_SLEEP               = 0x5F
	VK_NUMPAD0             = 0x60
	VK_NUMPAD1             = 0x61
	VK_NUMPAD2             = 0x62
	VK_NUMPAD3             = 0x63
	VK_NUMPAD4             = 0x64
	VK_NUMPAD5             = 0x65
	VK_NUMPAD6             = 0x66
	VK_NUMPAD7             = 0x67
	VK_NUMPAD8             = 0x68
	VK_NUMPAD9             = 0x69
	VK_MULTIPLY            = 0x6A
	VK_ADD                 = 0x6B
	VK_SEPARATOR           = 0x6C
	VK_SUBTRACT            = 0x6D
	VK_DECIMAL             = 0x6E
	VK_DIVIDE              = 0x6F
	VK_F1                  = 0x70
	VK_F2                  = 0x71
	VK_F3                  = 0x72
	VK_F4                  = 0x73
	VK_F5                  = 0x74
	VK_F6                  = 0x75
	VK_F7                  = 0x76
	VK_F8                  = 0x77
	VK_F9                  = 0x78
	VK_F10                 = 0x79
	VK_F11                 = 0x7A
	VK_F12                 = 0x7B
	VK_F13                 = 0x7C
	VK_F14                 = 0x7D
	VK_F15                 = 0x7E
	VK_F16                 = 0x7F
	VK_F17                 = 0x80
	VK_F18                 = 0x81
	VK_F19                 = 0x82
	VK_F20                 = 0x83
	VK_F21                 = 0x84
	VK_F22                 = 0x85
	VK_F23                 = 0x86
	VK_F24                 = 0x87
	VK_NUMLOCK             = 0x90
	VK_SCROLL              = 0x91
	VK_LSHIFT              = 0xA0
	VK_RSHIFT              = 0xA1
	VK_LCONTROL            = 0xA2
	VK_RCONTROL            = 0xA3
	VK_LMENU               = 0xA4
	VK_RMENU               = 0xA5
	VK_BROWSER_BACK        = 0xA6
	VK_BROWSER_FORWARD     = 0xA7
	VK_BROWSER_REFRESH     = 0xA8
	VK_BROWSER_STOP        = 0xA9
	VK_BROWSER_SEARCH      = 0xAA
	VK_BROWSER_FAVORITES   = 0xAB
	VK_BROWSER_HOME        = 0xAC
	VK_VOLUME_MUTE         = 0xAD
	VK_VOLUME_DOWN         = 0xAE
	VK_VOLUME_UP           = 0xAF
	VK_MEDIA_NEXT_TRACK    = 0xB0
	VK_MEDIA_PREV_TRACK    = 0xB1
	VK_MEDIA_STOP          = 0xB2
	VK_MEDIA_PLAY_PAUSE    = 0xB3
	VK_LAUNCH_MAIL         = 0xB4
	VK_LAUNCH_MEDIA_SELECT = 0xB5
	VK_LAUNCH_APP1         = 0xB6
	VK_LAUNCH_APP2         = 0xB7
	VK_OEM_1               = 0xBA
	VK_OEM_PLUS            = 0xBB
	VK_OEM_COMMA           = 0xBC
	VK_OEM_MINUS           = 0xBD
	VK_OEM_PERIOD          = 0xBE
	VK_OEM_2               = 0xBF
	VK_OEM_3               = 0xC0
	VK_OEM_4               = 0xDB
	VK_OEM_5               = 0xDC
	VK_OEM_6               = 0xDD
	VK_OEM_7               = 0xDE
	VK_OEM_8               = 0xDF
	VK_OEM_102             = 0xE2
	VK_PROCESSKEY          = 0xE5
	VK_PACKET              = 0xE7
	VK_ATTN                = 0xF6
	VK_CRSEL               = 0xF7
	VK_EXSEL               = 0xF8
	VK_EREOF               = 0xF9
	VK_PLAY                = 0xFA
	VK_ZOOM                = 0xFB
	VK_NONAME              = 0xFC
	VK_PA1                 = 0xFD
	VK_OEM_CLEAR           = 0xFE
)

Virtual key codes

View Source
const HCF_HIGHCONTRASTON = 0x00000001
View Source
const SPI_GETHIGHCONTRAST = 0x0042

Variables

View Source
var (
	AllowDarkModeForWindow func(HWND, bool) uintptr
	SetPreferredAppMode    func(int32) uintptr
)
View Source
var KeyMap = map[string]Key{}/* 133 elements not displayed */
View Source
var NoShortcut = Shortcut{}

Functions

func AltDown

func AltDown() bool

func CheckMenuItem

func CheckMenuItem(menu HMENU, id uintptr, flags uint) uint

func ControlDown

func ControlDown() bool

func CreateAcceleratorTable

func CreateAcceleratorTable(acc []Accelerator) uintptr

func CreateIconFromResourceEx

func CreateIconFromResourceEx(presbits uintptr, dwResSize uint32, isIcon bool, version uint32, cxDesired int, cyDesired int, flags uint) (uintptr, error)

func DispatchMessage

func DispatchMessage(msg *MSG) uintptr

func EnableBlurBehind

func EnableBlurBehind(hwnd HWND)

func EnableTranslucency

func EnableTranslucency(hwnd HWND, backdrop BackdropType)

func GetCursorPos

func GetCursorPos() (x, y int, ok bool)

func GetKeyState

func GetKeyState(nVirtKey int32) int16

func GetMessage

func GetMessage(msg *MSG) uintptr

func GetModuleHandle

func GetModuleHandle(value uintptr) uintptr

func IsCurrentlyDarkMode

func IsCurrentlyDarkMode() bool

func IsCurrentlyHighContrastMode

func IsCurrentlyHighContrastMode() bool

func IsDialogMessage

func IsDialogMessage(hwnd HWND, msg *MSG) uintptr

func IsWindowsVersionAtLeast

func IsWindowsVersionAtLeast(major, minor, buildNumber int) bool

func LoHiWords

func LoHiWords(input uint32) (uint16, uint16)

func MustStringToUTF16Ptr

func MustStringToUTF16Ptr(input string) *uint16

func MustStringToUTF16uintptr

func MustStringToUTF16uintptr(input string) uintptr

func MustUTF16FromString

func MustUTF16FromString(input string) []uint16

func PostMessage

func PostMessage(hwnd HWND, msg uint32, wParam, lParam uintptr) uintptr

func PostQuitMessage

func PostQuitMessage(exitCode int32)

func RegisterClass

func RegisterClass(className string, wndproc uintptr, instance HINSTANCE) error

func SetBorderColour

func SetBorderColour(hwnd HWND, titleBorderColour int32)

func SetForegroundWindow

func SetForegroundWindow(wnd HWND) bool

func SetTheme

func SetTheme(hwnd HWND, useDarkMode bool)

func SetTitleBarColour

func SetTitleBarColour(hwnd HWND, titleBarColour int32)

func SetTitleTextColour

func SetTitleTextColour(hwnd HWND, titleTextColour int32)

func SetWindowCompositionAttribute

func SetWindowCompositionAttribute(hwnd HWND, data *WINDOWCOMPOSITIONATTRIBDATA) bool

func SetWindowTheme

func SetWindowTheme(hwnd HWND, appName string, subIdList string) uintptr

func ShellNotifyIcon

func ShellNotifyIcon(cmd uintptr, nid *NOTIFYICONDATA) bool

func ShiftDown

func ShiftDown() bool

func SupportsBackdropTypes

func SupportsBackdropTypes() bool

func SupportsCustomThemes

func SupportsCustomThemes() bool

func SupportsImmersiveDarkMode

func SupportsImmersiveDarkMode() bool

func SupportsThemes

func SupportsThemes() bool

func TranslateAccelerator

func TranslateAccelerator(hwnd HWND, hAccTable uintptr, lpMsg *MSG) bool

func TranslateMessage

func TranslateMessage(msg *MSG) uintptr

func UTF16PtrToString

func UTF16PtrToString(input uintptr) string

func WMMessageToString

func WMMessageToString(msg uintptr) string

Types

type ACCENT_POLICY

type ACCENT_POLICY struct {
	AccentState   ACCENT_STATE
	AccentFlags   DWORD
	GradientColor DWORD
	AnimationId   DWORD
}

type ACCENT_STATE

type ACCENT_STATE DWORD
const (
	ACCENT_DISABLED                   ACCENT_STATE = 0
	ACCENT_ENABLE_GRADIENT            ACCENT_STATE = 1
	ACCENT_ENABLE_TRANSPARENTGRADIENT ACCENT_STATE = 2
	ACCENT_ENABLE_BLURBEHIND          ACCENT_STATE = 3
	ACCENT_ENABLE_ACRYLICBLURBEHIND   ACCENT_STATE = 4 // RS4 1803
	ACCENT_ENABLE_HOSTBACKDROP        ACCENT_STATE = 5 // RS5 1809
	ACCENT_INVALID_STATE              ACCENT_STATE = 6
)

type ATOM

type ATOM uint16

func RegisterClassEx

func RegisterClassEx(wndClassEx *WNDCLASSEX) ATOM

type Accelerator

type Accelerator struct {
	Virtual byte
	Key     uint16
	Cmd     uint16
}

type BackdropType

type BackdropType int32

BackdropType defines the type of translucency we wish to use

const (
	BackdropTypeAuto    BackdropType = 0
	BackdropTypeNone    BackdropType = 1
	BackdropTypeMica    BackdropType = 2
	BackdropTypeAcrylic BackdropType = 3
	BackdropTypeTabbed  BackdropType = 4
)

type DWMWINDOWATTRIBUTE

type DWMWINDOWATTRIBUTE int32
const DwmwaBorderColor DWMWINDOWATTRIBUTE = 34
const DwmwaCaptionColor DWMWINDOWATTRIBUTE = 35
const DwmwaSystemBackdropType DWMWINDOWATTRIBUTE = 38
const DwmwaTextColor DWMWINDOWATTRIBUTE = 36
const DwmwaUseImmersiveDarkMode DWMWINDOWATTRIBUTE = 20
const DwmwaUseImmersiveDarkModeBefore20h1 DWMWINDOWATTRIBUTE = 19

type DWORD

type DWORD = uint32

type HANDLE

type HANDLE uintptr

type HBRUSH

type HBRUSH = HANDLE

type HCURSOR

type HCURSOR = HANDLE

func LoadCursorWithResourceID

func LoadCursorWithResourceID(instance HINSTANCE, res uintptr) HCURSOR

type HICON

type HICON = HANDLE

func CreateHIconFromPNG

func CreateHIconFromPNG(pngData []byte) (HICON, error)

CreateHIconFromPNG creates a HICON from a PNG file

func LoadIconWithResourceID

func LoadIconWithResourceID(instance HINSTANCE, res uintptr) HICON

type HINSTANCE

type HINSTANCE = HANDLE

type HMENU

type HMENU = HANDLE

type HWND

type HWND = HANDLE

func CreateWindow

func CreateWindow(className string, instance HINSTANCE, parent HWND, exStyle, style uint) HWND

func CreateWindowEx

func CreateWindowEx(exStyle uint, className, windowName *uint16,
	style uint, x, y, width, height int, parent HWND, menu HMENU,
	instance HINSTANCE, param unsafe.Pointer) HWND

type Key

type Key uint16
const (
	KeyLButton           Key = VK_LBUTTON
	KeyRButton           Key = VK_RBUTTON
	KeyCancel            Key = VK_CANCEL
	KeyMButton           Key = VK_MBUTTON
	KeyXButton1          Key = VK_XBUTTON1
	KeyXButton2          Key = VK_XBUTTON2
	KeyBack              Key = VK_BACK
	KeyTab               Key = VK_TAB
	KeyClear             Key = VK_CLEAR
	KeyReturn            Key = VK_RETURN
	KeyShift             Key = VK_SHIFT
	KeyControl           Key = VK_CONTROL
	KeyAlt               Key = VK_MENU
	KeyMenu              Key = VK_MENU
	KeyPause             Key = VK_PAUSE
	KeyCapital           Key = VK_CAPITAL
	KeyKana              Key = VK_KANA
	KeyHangul            Key = VK_HANGUL
	KeyJunja             Key = VK_JUNJA
	KeyFinal             Key = VK_FINAL
	KeyHanja             Key = VK_HANJA
	KeyKanji             Key = VK_KANJI
	KeyEscape            Key = VK_ESCAPE
	KeyConvert           Key = VK_CONVERT
	KeyNonconvert        Key = VK_NONCONVERT
	KeyAccept            Key = VK_ACCEPT
	KeyModeChange        Key = VK_MODECHANGE
	KeySpace             Key = VK_SPACE
	KeyPrior             Key = VK_PRIOR
	KeyNext              Key = VK_NEXT
	KeyEnd               Key = VK_END
	KeyHome              Key = VK_HOME
	KeyLeft              Key = VK_LEFT
	KeyUp                Key = VK_UP
	KeyRight             Key = VK_RIGHT
	KeyDown              Key = VK_DOWN
	KeySelect            Key = VK_SELECT
	KeyPrint             Key = VK_PRINT
	KeyExecute           Key = VK_EXECUTE
	KeySnapshot          Key = VK_SNAPSHOT
	KeyInsert            Key = VK_INSERT
	KeyDelete            Key = VK_DELETE
	KeyHelp              Key = VK_HELP
	Key0                 Key = 0x30
	Key1                 Key = 0x31
	Key2                 Key = 0x32
	Key3                 Key = 0x33
	Key4                 Key = 0x34
	Key5                 Key = 0x35
	Key6                 Key = 0x36
	Key7                 Key = 0x37
	Key8                 Key = 0x38
	Key9                 Key = 0x39
	KeyA                 Key = 0x41
	KeyB                 Key = 0x42
	KeyC                 Key = 0x43
	KeyD                 Key = 0x44
	KeyE                 Key = 0x45
	KeyF                 Key = 0x46
	KeyG                 Key = 0x47
	KeyH                 Key = 0x48
	KeyI                 Key = 0x49
	KeyJ                 Key = 0x4A
	KeyK                 Key = 0x4B
	KeyL                 Key = 0x4C
	KeyM                 Key = 0x4D
	KeyN                 Key = 0x4E
	KeyO                 Key = 0x4F
	KeyP                 Key = 0x50
	KeyQ                 Key = 0x51
	KeyR                 Key = 0x52
	KeyS                 Key = 0x53
	KeyT                 Key = 0x54
	KeyU                 Key = 0x55
	KeyV                 Key = 0x56
	KeyW                 Key = 0x57
	KeyX                 Key = 0x58
	KeyY                 Key = 0x59
	KeyZ                 Key = 0x5A
	KeyLWIN              Key = VK_LWIN
	KeyRWIN              Key = VK_RWIN
	KeyApps              Key = VK_APPS
	KeySleep             Key = VK_SLEEP
	KeyNumpad0           Key = VK_NUMPAD0
	KeyNumpad1           Key = VK_NUMPAD1
	KeyNumpad2           Key = VK_NUMPAD2
	KeyNumpad3           Key = VK_NUMPAD3
	KeyNumpad4           Key = VK_NUMPAD4
	KeyNumpad5           Key = VK_NUMPAD5
	KeyNumpad6           Key = VK_NUMPAD6
	KeyNumpad7           Key = VK_NUMPAD7
	KeyNumpad8           Key = VK_NUMPAD8
	KeyNumpad9           Key = VK_NUMPAD9
	KeyMultiply          Key = VK_MULTIPLY
	KeyAdd               Key = VK_ADD
	KeySeparator         Key = VK_SEPARATOR
	KeySubtract          Key = VK_SUBTRACT
	KeyDecimal           Key = VK_DECIMAL
	KeyDivide            Key = VK_DIVIDE
	KeyF1                Key = VK_F1
	KeyF2                Key = VK_F2
	KeyF3                Key = VK_F3
	KeyF4                Key = VK_F4
	KeyF5                Key = VK_F5
	KeyF6                Key = VK_F6
	KeyF7                Key = VK_F7
	KeyF8                Key = VK_F8
	KeyF9                Key = VK_F9
	KeyF10               Key = VK_F10
	KeyF11               Key = VK_F11
	KeyF12               Key = VK_F12
	KeyF13               Key = VK_F13
	KeyF14               Key = VK_F14
	KeyF15               Key = VK_F15
	KeyF16               Key = VK_F16
	KeyF17               Key = VK_F17
	KeyF18               Key = VK_F18
	KeyF19               Key = VK_F19
	KeyF20               Key = VK_F20
	KeyF21               Key = VK_F21
	KeyF22               Key = VK_F22
	KeyF23               Key = VK_F23
	KeyF24               Key = VK_F24
	KeyNumlock           Key = VK_NUMLOCK
	KeyScroll            Key = VK_SCROLL
	KeyLShift            Key = VK_LSHIFT
	KeyRShift            Key = VK_RSHIFT
	KeyLControl          Key = VK_LCONTROL
	KeyRControl          Key = VK_RCONTROL
	KeyLAlt              Key = VK_LMENU
	KeyLMenu             Key = VK_LMENU
	KeyRAlt              Key = VK_RMENU
	KeyRMenu             Key = VK_RMENU
	KeyBrowserBack       Key = VK_BROWSER_BACK
	KeyBrowserForward    Key = VK_BROWSER_FORWARD
	KeyBrowserRefresh    Key = VK_BROWSER_REFRESH
	KeyBrowserStop       Key = VK_BROWSER_STOP
	KeyBrowserSearch     Key = VK_BROWSER_SEARCH
	KeyBrowserFavorites  Key = VK_BROWSER_FAVORITES
	KeyBrowserHome       Key = VK_BROWSER_HOME
	KeyVolumeMute        Key = VK_VOLUME_MUTE
	KeyVolumeDown        Key = VK_VOLUME_DOWN
	KeyVolumeUp          Key = VK_VOLUME_UP
	KeyMediaNextTrack    Key = VK_MEDIA_NEXT_TRACK
	KeyMediaPrevTrack    Key = VK_MEDIA_PREV_TRACK
	KeyMediaStop         Key = VK_MEDIA_STOP
	KeyMediaPlayPause    Key = VK_MEDIA_PLAY_PAUSE
	KeyLaunchMail        Key = VK_LAUNCH_MAIL
	KeyLaunchMediaSelect Key = VK_LAUNCH_MEDIA_SELECT
	KeyLaunchApp1        Key = VK_LAUNCH_APP1
	KeyLaunchApp2        Key = VK_LAUNCH_APP2
	KeyOEM1              Key = VK_OEM_1
	KeyOEMPlus           Key = VK_OEM_PLUS
	KeyOEMComma          Key = VK_OEM_COMMA
	KeyOEMMinus          Key = VK_OEM_MINUS
	KeyOEMPeriod         Key = VK_OEM_PERIOD
	KeyOEM2              Key = VK_OEM_2
	KeyOEM3              Key = VK_OEM_3
	KeyOEM4              Key = VK_OEM_4
	KeyOEM5              Key = VK_OEM_5
	KeyOEM6              Key = VK_OEM_6
	KeyOEM7              Key = VK_OEM_7
	KeyOEM8              Key = VK_OEM_8
	KeyOEM102            Key = VK_OEM_102
	KeyProcessKey        Key = VK_PROCESSKEY
	KeyPacket            Key = VK_PACKET
	KeyAttn              Key = VK_ATTN
	KeyCRSel             Key = VK_CRSEL
	KeyEXSel             Key = VK_EXSEL
	KeyErEOF             Key = VK_EREOF
	KeyPlay              Key = VK_PLAY
	KeyZoom              Key = VK_ZOOM
	KeyNoName            Key = VK_NONAME
	KeyPA1               Key = VK_PA1
	KeyOEMClear          Key = VK_OEM_CLEAR
)

func (Key) String

func (k Key) String() string

type MSG

type MSG struct {
	HWnd    HWND
	Message uint32
	WParam  uintptr
	LParam  uintptr
	Time    uint32
	Pt      POINT
}
type Menu HMENU
func (m Menu) Append(flags uintptr, id uintptr, text string) bool
func (m Menu) Check(id uintptr, check bool) bool
func (m Menu) CheckRadio(startID int, endID int, selectedID int) bool
func (m Menu) Destroy() bool
type MenuID uint16

type Modifiers

type Modifiers byte
const (
	ModShift Modifiers = 1 << iota
	ModControl
	ModAlt
)

func ModifiersDown

func ModifiersDown() Modifiers

func (Modifiers) String

func (m Modifiers) String() string

type NOTIFYICONDATA

type NOTIFYICONDATA struct {
	CbSize           uint32
	HWnd             HWND
	UID              uint32
	UFlags           uint32
	UCallbackMessage uint32
	HIcon            HICON
	SzTip            [128]uint16
	DwState          uint32
	DwStateMask      uint32
	SzInfo           [256]uint16
	UVersion         uint32
	SzInfoTitle      [64]uint16
	DwInfoFlags      uint32
	GuidItem         windows.GUID
	HBalloonIcon     HICON
}

type POINT

type POINT struct {
	X, Y int32
}

type PopupMenu

type PopupMenu Menu

func CreatePopupMenu

func CreatePopupMenu() PopupMenu

func (PopupMenu) Append

func (p PopupMenu) Append(flags uintptr, id uintptr, text string) bool

func (PopupMenu) Check

func (p PopupMenu) Check(id uintptr, checked bool) bool

func (PopupMenu) CheckRadio

func (p PopupMenu) CheckRadio(startID, endID, selectedID int) bool

func (PopupMenu) Destroy

func (p PopupMenu) Destroy() bool

func (PopupMenu) Track

func (p PopupMenu) Track(flags uint, x, y int, wnd HWND) bool

type PreferredAppMode

type PreferredAppMode = int32
const (
	PreferredAppModeDefault PreferredAppMode = iota
	PreferredAppModeAllowDark
	PreferredAppModeForceDark
	PreferredAppModeForceLight
	PreferredAppModeMax
)

type Shortcut

type Shortcut struct {
	Modifiers Modifiers
	Key       Key
}

func AcceleratorToShortcut

func AcceleratorToShortcut(accelerator *keys.Accelerator) Shortcut

func (Shortcut) String

func (s Shortcut) String() string

type WINDOWCOMPOSITIONATTRIB

type WINDOWCOMPOSITIONATTRIB DWORD
const WCA_ACCENT_POLICY WINDOWCOMPOSITIONATTRIB = 19

type WINDOWCOMPOSITIONATTRIBDATA

type WINDOWCOMPOSITIONATTRIBDATA struct {
	Attrib WINDOWCOMPOSITIONATTRIB
	PvData unsafe.Pointer
	CbData uintptr
}

type WNDCLASSEX

type WNDCLASSEX struct {
	CbSize        uint32
	Style         uint32
	LpfnWndProc   uintptr
	CbClsExtra    int32
	CbWndExtra    int32
	HInstance     HINSTANCE
	HIcon         HICON
	HCursor       HCURSOR
	HbrBackground HBRUSH
	LpszMenuName  *uint16
	LpszClassName *uint16
	HIconSm       HICON
}

type WindowProc

type WindowProc func(hwnd HWND, msg uint32, wparam, lparam uintptr) uintptr

Jump to

Keyboard shortcuts

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