w32

package
v0.0.0-...-1d0ab5d Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: MIT, MIT Imports: 4 Imported by: 0

Documentation

Rendered for windows/amd64

Overview

Package w32 将用到的 win32 API 以及相关数据结构封装为 Go 模式

Index

Constants

View Source
const (
	SystemMetricsCxIcon = 11
	SystemMetricsCyIcon = 12
)
View Source
const (
	SWHide = 0
	SWShow = 5
)

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

View Source
const (
	SWPNoZOrder     = 0x0004
	SWPNoActivate   = 0x0010
	SWPNoMove       = 0x0002
	SWPFrameChanged = 0x0020
)

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

View Source
const (
	WMDestroy       = 0x0002
	WMMove          = 0x0003
	WMSize          = 0x0005
	WMActivate      = 0x0006
	WMClose         = 0x0010
	WMQuit          = 0x0012
	WMGetMinMaxInfo = 0x0024
	WMNCLButtonDown = 0x00A1
	WMMoving        = 0x0216
	WMApp           = 0x8000
)
View Source
const (
	GAParent    = 1
	GARoot      = 2
	GARootOwner = 3
)
View Source
const (
	WAInactive    = 0
	WAActive      = 1
	WAActiveClick = 2
)
View Source
const (
	CW_USEDEFAULT = 0x80000000
)
View Source
const (
	GWLStyle = -16
)

Variables

This section is empty.

Functions

func AdjustWindowRect

func AdjustWindowRect(rect *windows.Rect, style int, menu bool)

func CreateWindowEx

func CreateWindowEx(
	exStyle, className, windowName, style uintptr, point webview.Point, size webview.Size, parent, menu, inst, param uintptr) (uintptr, error)

func DefWindowProc

func DefWindowProc(hwnd, msg, wp, lp uintptr) uintptr

func DestroyWindow

func DestroyWindow(h uintptr)

func DispatchMessage

func DispatchMessage(m *Msg)

func GetAncestor

func GetAncestor(h uintptr, flag uint) uintptr

func GetClientRect

func GetClientRect(h uintptr, rect *windows.Rect)

func GetMessage

func GetMessage(m *Msg, h uintptr, min, max uint) int

func GetSystemMetrics

func GetSystemMetrics(v uintptr) uintptr

func GetWindowLongPtr

func GetWindowLongPtr(h uintptr, index int) int

func IsDialogMessage

func IsDialogMessage(h uintptr, msg *Msg) bool

func LoadImage

func LoadImage(instance uintptr) uintptr

func PostQuitMessage

func PostQuitMessage(code int)

func PostThreadMessage

func PostThreadMessage(thread uintptr, msg uint, w, l uintptr)

func RegisterClassEx

func RegisterClassEx(wc *WndClassExW) error

func SHCreateMemStream

func SHCreateMemStream(data []byte) (uintptr, error)

func SetFocus

func SetFocus(h uintptr)

func SetWindowLongPtr

func SetWindowLongPtr(h uintptr, index, style int)

func SetWindowPos

func SetWindowPos(h, z uintptr, p webview.Point, size webview.Size, flag uint)

func SetWindowText

func SetWindowText(h uintptr, title string) error

func ShowWindow

func ShowWindow(h uintptr, style int)

func TranslateMessage

func TranslateMessage(m *Msg)

func UpdateWindow

func UpdateWindow(h uintptr)

Types

type MinMaxInfo

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

type Msg

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

type Point

type Point struct {
	X, Y int32
}

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