windows

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT, Unlicense Imports: 6 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	TRUE = 1

	CPS_CANCEL = 0x0004

	CS_HREDRAW     = 0x0002
	CS_INSERTCHAR  = 0x2000
	CS_NOMOVECARET = 0x4000
	CS_VREDRAW     = 0x0001
	CS_OWNDC       = 0x0020

	CW_USEDEFAULT = -2147483648

	GWL_STYLE = ^(uintptr(16) - 1) // -16

	GCS_COMPSTR       = 0x0008
	GCS_COMPREADSTR   = 0x0001
	GCS_CURSORPOS     = 0x0080
	GCS_DELTASTART    = 0x0100
	GCS_RESULTREADSTR = 0x0200
	GCS_RESULTSTR     = 0x0800

	CFS_POINT        = 0x0002
	CFS_CANDIDATEPOS = 0x0040

	HWND_TOPMOST = ^(uint32(1) - 1) // -1

	HTCAPTION     = 2
	HTCLIENT      = 1
	HTLEFT        = 10
	HTRIGHT       = 11
	HTTOP         = 12
	HTTOPLEFT     = 13
	HTTOPRIGHT    = 14
	HTBOTTOM      = 15
	HTBOTTOMLEFT  = 16
	HTBOTTOMRIGHT = 17

	IDC_APPSTARTING = 32650 // Standard arrow and small hourglass
	IDC_ARROW       = 32512 // Standard arrow
	IDC_CROSS       = 32515 // Crosshair
	IDC_HAND        = 32649 // Hand
	IDC_HELP        = 32651 // Arrow and question mark
	IDC_IBEAM       = 32513 // I-beam
	IDC_NO          = 32648 // Slashed circle
	IDC_SIZEALL     = 32646 // Four-pointed arrow pointing north, south, east, and west
	IDC_SIZENESW    = 32643 // Double-pointed arrow pointing northeast and southwest
	IDC_SIZENS      = 32645 // Double-pointed arrow pointing north and south
	IDC_SIZENWSE    = 32642 // Double-pointed arrow pointing northwest and southeast
	IDC_SIZEWE      = 32644 // Double-pointed arrow pointing west and east
	IDC_UPARROW     = 32516 // Vertical arrow
	IDC_WAIT        = 32514 // Hour

	INFINITE = 0xFFFFFFFF

	LOGPIXELSX = 88

	MDT_EFFECTIVE_DPI = 0

	MONITOR_DEFAULTTOPRIMARY = 1

	NI_COMPOSITIONSTR = 0x0015

	SIZE_MAXIMIZED = 2
	SIZE_MINIMIZED = 1
	SIZE_RESTORED  = 0

	SCS_SETSTR = GCS_COMPREADSTR | GCS_COMPSTR

	SM_CXSIZEFRAME = 32
	SM_CYSIZEFRAME = 33

	SW_SHOWDEFAULT   = 10
	SW_SHOWMINIMIZED = 2
	SW_SHOWMAXIMIZED = 3
	SW_SHOWNORMAL    = 1
	SW_SHOW          = 5

	SWP_FRAMECHANGED  = 0x0020
	SWP_NOMOVE        = 0x0002
	SWP_NOOWNERZORDER = 0x0200
	SWP_NOSIZE        = 0x0001
	SWP_NOZORDER      = 0x0004
	SWP_SHOWWINDOW    = 0x0040

	USER_TIMER_MINIMUM = 0x0000000A

	VK_CONTROL = 0x11
	VK_LWIN    = 0x5B
	VK_MENU    = 0x12
	VK_RWIN    = 0x5C
	VK_SHIFT   = 0x10

	VK_BACK   = 0x08
	VK_DELETE = 0x2e
	VK_DOWN   = 0x28
	VK_END    = 0x23
	VK_ESCAPE = 0x1b
	VK_HOME   = 0x24
	VK_LEFT   = 0x25
	VK_NEXT   = 0x22
	VK_PRIOR  = 0x21
	VK_RIGHT  = 0x27
	VK_RETURN = 0x0d
	VK_SPACE  = 0x20
	VK_TAB    = 0x09
	VK_UP     = 0x26

	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_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_102    = 0xe2

	UNICODE_NOCHAR = 65535

	WM_CANCELMODE           = 0x001F
	WM_CHAR                 = 0x0102
	WM_CLOSE                = 0x0010
	WM_CREATE               = 0x0001
	WM_DPICHANGED           = 0x02E0
	WM_DESTROY              = 0x0002
	WM_ERASEBKGND           = 0x0014
	WM_GETMINMAXINFO        = 0x0024
	WM_IME_COMPOSITION      = 0x010F
	WM_IME_ENDCOMPOSITION   = 0x010E
	WM_IME_STARTCOMPOSITION = 0x010D
	WM_KEYDOWN              = 0x0100
	WM_KEYUP                = 0x0101
	WM_KILLFOCUS            = 0x0008
	WM_LBUTTONDOWN          = 0x0201
	WM_LBUTTONUP            = 0x0202
	WM_MBUTTONDOWN          = 0x0207
	WM_MBUTTONUP            = 0x0208
	WM_MOUSEMOVE            = 0x0200
	WM_MOUSEWHEEL           = 0x020A
	WM_MOUSEHWHEEL          = 0x020E
	WM_NCACTIVATE           = 0x0086
	WM_NCHITTEST            = 0x0084
	WM_NCCALCSIZE           = 0x0083
	WM_PAINT                = 0x000F
	WM_QUIT                 = 0x0012
	WM_SETCURSOR            = 0x0020
	WM_SETFOCUS             = 0x0007
	WM_SHOWWINDOW           = 0x0018
	WM_SIZE                 = 0x0005
	WM_SYSKEYDOWN           = 0x0104
	WM_SYSKEYUP             = 0x0105
	WM_RBUTTONDOWN          = 0x0204
	WM_RBUTTONUP            = 0x0205
	WM_TIMER                = 0x0113
	WM_UNICHAR              = 0x0109
	WM_USER                 = 0x0400
	WM_WINDOWPOSCHANGED     = 0x0047

	WS_CLIPCHILDREN     = 0x02000000
	WS_CLIPSIBLINGS     = 0x04000000
	WS_MAXIMIZE         = 0x01000000
	WS_ICONIC           = 0x20000000
	WS_VISIBLE          = 0x10000000
	WS_OVERLAPPED       = 0x00000000
	WS_OVERLAPPEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME |
		WS_MINIMIZEBOX | WS_MAXIMIZEBOX
	WS_CAPTION     = 0x00C00000
	WS_SYSMENU     = 0x00080000
	WS_THICKFRAME  = 0x00040000
	WS_MINIMIZEBOX = 0x00020000
	WS_MAXIMIZEBOX = 0x00010000

	WS_EX_APPWINDOW  = 0x00040000
	WS_EX_WINDOWEDGE = 0x00000100

	QS_ALLINPUT = 0x04FF

	MWMO_WAITALL        = 0x0001
	MWMO_INPUTAVAILABLE = 0x0004

	WAIT_OBJECT_0 = 0

	PM_REMOVE   = 0x0001
	PM_NOREMOVE = 0x0000

	GHND = 0x0042

	CF_UNICODETEXT = 13
	IMAGE_BITMAP   = 0
	IMAGE_ICON     = 1
	IMAGE_CURSOR   = 2

	LR_CREATEDIBSECTION = 0x00002000
	LR_DEFAULTCOLOR     = 0x00000000
	LR_DEFAULTSIZE      = 0x00000040
	LR_LOADFROMFILE     = 0x00000010
	LR_LOADMAP3DCOLORS  = 0x00001000
	LR_LOADTRANSPARENT  = 0x00000020
	LR_MONOCHROME       = 0x00000001
	LR_SHARED           = 0x00008000
	LR_VGACOLOR         = 0x00000080
)

Variables

This section is empty.

Functions

func AdjustWindowRectEx

func AdjustWindowRectEx(r *Rect, dwStyle uint32, bMenu int, dwExStyle uint32)

func CallMsgFilter

func CallMsgFilter(m *Msg, nCode uintptr) bool

func CloseClipboard

func CloseClipboard() error

func CreateWindowEx

func CreateWindowEx(dwExStyle uint32, lpClassName uint16, lpWindowName string, dwStyle uint32, x, y, w, h int32, hWndParent, hMenu, hInstance syscall.Handle, lpParam uintptr) (syscall.Handle, error)

func DefWindowProc

func DefWindowProc(hwnd syscall.Handle, msg uint32, wparam, lparam uintptr) uintptr

func DestroyWindow

func DestroyWindow(hwnd syscall.Handle)

func DispatchMessage

func DispatchMessage(m *Msg)

func DwmExtendFrameIntoClientArea added in v0.3.0

func DwmExtendFrameIntoClientArea(hwnd syscall.Handle, margins Margins) error

func EmptyClipboard

func EmptyClipboard() error

func GetClipboardData

func GetClipboardData(format uint32) (syscall.Handle, error)

func GetDC

func GetDC(hwnd syscall.Handle) (syscall.Handle, error)

func GetKeyState

func GetKeyState(nVirtKey int32) int16

func GetMessage

func GetMessage(m *Msg, hwnd syscall.Handle, wMsgFilterMin, wMsgFilterMax uint32) int32

func GetMessageTime

func GetMessageTime() time.Duration

func GetModuleHandle

func GetModuleHandle() (syscall.Handle, error)

func GetSystemDPI

func GetSystemDPI() int

GetSystemDPI returns the effective DPI of the system.

func GetSystemMetrics

func GetSystemMetrics(nIndex int) int

func GetWindowDPI

func GetWindowDPI(hwnd syscall.Handle) int

GetWindowDPI returns the effective DPI of the window.

func GetWindowLong

func GetWindowLong(hwnd syscall.Handle, index uintptr) (val uintptr)

func GlobalAlloc

func GlobalAlloc(size int) (syscall.Handle, error)

func GlobalFree

func GlobalFree(h syscall.Handle)

func GlobalLock

func GlobalLock(h syscall.Handle) (unsafe.Pointer, error)

func GlobalUnlock

func GlobalUnlock(h syscall.Handle)

func ImmGetCompositionString

func ImmGetCompositionString(imc syscall.Handle, key int) string

func ImmGetCompositionValue

func ImmGetCompositionValue(imc syscall.Handle, key int) int

func ImmGetContext

func ImmGetContext(hwnd syscall.Handle) syscall.Handle

func ImmNotifyIME

func ImmNotifyIME(imc syscall.Handle, action, index, value int)

func ImmReleaseContext

func ImmReleaseContext(hwnd, imc syscall.Handle)

func ImmSetCandidateWindow

func ImmSetCandidateWindow(imc syscall.Handle, x, y int)

func ImmSetCompositionWindow

func ImmSetCompositionWindow(imc syscall.Handle, x, y int)

func KillTimer

func KillTimer(hwnd syscall.Handle, nIDEvent uintptr) error

func LoadCursor

func LoadCursor(curID uint16) (syscall.Handle, error)

func LoadImage

func LoadImage(hInst syscall.Handle, res uint32, typ uint32, cx, cy int, fuload uint32) (syscall.Handle, error)

func MoveWindow

func MoveWindow(hwnd syscall.Handle, x, y, width, height int32, repaint bool)

func MsgWaitForMultipleObjectsEx

func MsgWaitForMultipleObjectsEx(nCount uint32, pHandles uintptr, millis, mask, flags uint32) (uint32, error)

func OpenClipboard

func OpenClipboard(hwnd syscall.Handle) error

func PeekMessage

func PeekMessage(m *Msg, hwnd syscall.Handle, wMsgFilterMin, wMsgFilterMax, wRemoveMsg uint32) bool

func PostMessage

func PostMessage(hwnd syscall.Handle, msg uint32, wParam, lParam uintptr) error

func PostQuitMessage

func PostQuitMessage(exitCode uintptr)

func RegisterClassEx

func RegisterClassEx(cls *WndClassEx) (uint16, error)

func ReleaseCapture

func ReleaseCapture() bool

func ReleaseDC

func ReleaseDC(hdc syscall.Handle)

func ScreenToClient

func ScreenToClient(hwnd syscall.Handle, p *Point)

func SetCapture

func SetCapture(hwnd syscall.Handle) syscall.Handle

func SetClipboardData

func SetClipboardData(format uint32, mem syscall.Handle) error

func SetCursor

func SetCursor(h syscall.Handle)

func SetFocus

func SetFocus(hwnd syscall.Handle)

func SetForegroundWindow

func SetForegroundWindow(hwnd syscall.Handle)

func SetProcessDPIAware

func SetProcessDPIAware()

func SetTimer

func SetTimer(hwnd syscall.Handle, nIDEvent uintptr, uElapse uint32, timerProc uintptr) error

func SetWindowLong

func SetWindowLong(hwnd syscall.Handle, idx uintptr, style uintptr)

func SetWindowPlacement

func SetWindowPlacement(hwnd syscall.Handle, wp *WindowPlacement)

func SetWindowPos

func SetWindowPos(hwnd syscall.Handle, hwndInsertAfter uint32, x, y, dx, dy int32, style uintptr)

func SetWindowText

func SetWindowText(hwnd syscall.Handle, title string)

func ShowWindow

func ShowWindow(hwnd syscall.Handle, nCmdShow int32)

func TranslateMessage

func TranslateMessage(m *Msg)

func UnregisterClass

func UnregisterClass(cls uint16, hInst syscall.Handle)

func UpdateWindow

func UpdateWindow(hwnd syscall.Handle)

Types

type CandidateForm

type CandidateForm struct {
	// contains filtered or unexported fields
}

type CompositionForm

type CompositionForm struct {
	// contains filtered or unexported fields
}

type Margins added in v0.3.0

type Margins struct {
	CxLeftWidth    int32
	CxRightWidth   int32
	CyTopHeight    int32
	CyBottomHeight int32
}

type MinMaxInfo

type MinMaxInfo struct {
	PtReserved     Point
	PtMaxSize      Point
	PtMaxPosition  Point
	PtMinTrackSize Point
	PtMaxTrackSize Point
}

type MonitorInfo

type MonitorInfo struct {
	Monitor  Rect
	WorkArea Rect
	Flags    uint32
	// contains filtered or unexported fields
}

func GetMonitorInfo

func GetMonitorInfo(hwnd syscall.Handle) MonitorInfo

type Msg

type Msg struct {
	Hwnd     syscall.Handle
	Message  uint32
	WParam   uintptr
	LParam   uintptr
	Time     uint32
	Pt       Point
	LPrivate uint32
}

type NCCalcSizeParams added in v0.3.1

type NCCalcSizeParams struct {
	Rgrc  [3]Rect
	LpPos *WindowPos
}

type Point

type Point struct {
	X, Y int32
}

type Rect

type Rect struct {
	Left, Top, Right, Bottom int32
}

func GetClientRect added in v0.3.1

func GetClientRect(hwnd syscall.Handle) Rect

func GetWindowRect

func GetWindowRect(hwnd syscall.Handle) Rect

type WindowPlacement

type WindowPlacement struct {
	// contains filtered or unexported fields
}

func GetWindowPlacement

func GetWindowPlacement(hwnd syscall.Handle) *WindowPlacement

func (WindowPlacement) IsMaximized

func (p WindowPlacement) IsMaximized() bool

func (WindowPlacement) IsMinimized

func (p WindowPlacement) IsMinimized() bool

func (WindowPlacement) Rect

func (p WindowPlacement) Rect() Rect

func (*WindowPlacement) Set

func (p *WindowPlacement) Set(Left, Top, Right, Bottom int)

type WindowPos added in v0.3.1

type WindowPos struct {
	HWND            syscall.Handle
	HWNDInsertAfter syscall.Handle
	// contains filtered or unexported fields
}

type WndClassEx

type WndClassEx struct {
	CbSize        uint32
	Style         uint32
	LpfnWndProc   uintptr
	CnClsExtra    int32
	CbWndExtra    int32
	HInstance     syscall.Handle
	HIcon         syscall.Handle
	HCursor       syscall.Handle
	HbrBackground syscall.Handle
	LpszMenuName  *uint16
	LpszClassName *uint16
	HIconSm       syscall.Handle
}

Jump to

Keyboard shortcuts

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