user32

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package user32 wraps some calls from the user32.dll to make them slightly easier to use.

Index

Constants

View Source
const (
	CW_USEDEFAULT = 0x80000000

	SystemMetricsCxScreen = 0
	SystemMetricsCyScreen = 1
	SystemMetricsCxIcon   = 11
	SystemMetricsCyIcon   = 12

	GWLStyle = -16

	WSOverlapped       = 0x00000000
	WSMaximizeBox      = 0x00020000
	WSThickFrame       = 0x00040000
	WSCaption          = 0x00C00000
	WSSysMenu          = 0x00080000
	WSMinimizeBox      = 0x00020000
	WSOverlappedWindow = (WSOverlapped | WSCaption | WSSysMenu | WSThickFrame | WSMinimizeBox | WSMaximizeBox)

	SWPNoZOrder     = 0x0004
	SWPNoActivate   = 0x0010
	SWPNoSize       = 0x0001
	SWPNoMove       = 0x0002
	SWPFrameChanged = 0x0020

	WMDestroy       = 0x0002
	WMSize          = 0x0005
	WMClose         = 0x0010
	WMQuit          = 0x0012
	WMGetMinMaxInfo = 0x0024
	WMApp           = 0x8000
)
View Source
const (
	SW_HIDE = iota
	SW_SHOWNORMAL
	SW_SHOWMINIMIZED
	SW_SHOWMAXIMIZED
	SW_SHOWNOACTIVATE
	SW_SHOW
	SW_MINIMIZE
	SW_SHOWMINNOACTIVE
	SW_SHOWNA
	SW_RESTORE
	SW_SHOWDEFAULT
	SW_FORCEMINIMIZE
)

Variables

This section is empty.

Functions

func AdjustWindowRec

func AdjustWindowRec(rect *Rect, style uintptr, hasMenu bool) error

func CreateWindowExW

func CreateWindowExW(className, windowName string, x, y, width, height int, hInstance windows.Handle) (windows.Handle, error)

func DefWindowProcW

func DefWindowProcW(hwnd, msg, wp, lp uintptr) (uintptr, error)

func DestroyWindow

func DestroyWindow(hwnd windows.Handle) error

func DispatchMessageW

func DispatchMessageW(msg *Msg) error

func GetSystemMetrics

func GetSystemMetrics(metric uintptr) (uintptr, error)

func GetWindowLongPtrW

func GetWindowLongPtrW(hwnd windows.Handle, nIndex uintptr) (uintptr, error)

func LoadImageW

func LoadImageW(hInstance windows.Handle, cx, cy uintptr) (windows.Handle, error)

func PostQuitMessage

func PostQuitMessage(exitCode int) error

func RegisterClassExW

func RegisterClassExW(wc *WndClassExW) error

func SetFocus

func SetFocus(hwnd windows.Handle) error

func SetWindowLongPtrW

func SetWindowLongPtrW(hwnd windows.Handle, nIndex uintptr, newLong uintptr) error

func SetWindowPos

func SetWindowPos(hwnd windows.Handle, x, y, cx, cy int32, flags uintptr) error

func SetWindowTextW

func SetWindowTextW(hwnd windows.Handle, text string) error

func ShowWindow

func ShowWindow(hwnd windows.Handle, cmdShow int) error

func TranslateMessage

func TranslateMessage(msg *Msg) error

Types

type MinMaxInfo

type MinMaxInfo struct {
	Reserved     Point
	MaxSize      Point
	MaxPosition  Point
	MinTrackSize Point
	MaxTrackSize Point
}

type Msg

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

func GetMessageW

func GetMessageW() (*Msg, error)

type Point

type Point struct {
	X, Y int32
}

type Rect

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

func GetClientRect

func GetClientRect(hwnd windows.Handle) (*Rect, error)

type WndClassExW

type WndClassExW struct {
	CBSize        uint32
	Style         uint32
	LpfnWndProc   uintptr
	CnClsExtra    int32
	CBWndExtra    int32
	HInstance     windows.Handle
	HIcon         windows.Handle
	HCursor       windows.Handle
	HbrBackground windows.Handle
	LpszMenuName  *uint16
	LpszClassName *uint16
	HIconSm       windows.Handle
}

Jump to

Keyboard shortcuts

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