win32

package
v0.0.0-...-eb302e4 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FALSE = 0
	TRUE  = 1
)
View Source
const (
	CF_UNICODETEXT = 13
	CF_HDROP       = 15
)

clipboard format

View Source
const (
	SC_MINIMIZE   = 0xF020
	SC_RESTORE    = 0xF120
	SC_PREVWINDOW = 0xF050
)

sys command

View Source
const (
	WM_NULL            = 0x0000
	WM_DESTROY         = 0x0002
	WM_CLIPBOARDUPDATE = 0x0000031D
	// HWND_MESSAGE       = ^uint32(2)
	WM_QUIT        = 0x00000012
	WM_KEYDOWN     = 0x0100
	WM_KEYUP       = 0x0101
	WM_SYSKEYDOWN  = 0x0104
	WM_SYSKEYUP    = 0x0105
	WM_SYSCOMMAND  = 0x0112
	WM_IME_KEYDOWN = 0x0290
	WM_IME_KEYUP   = 0x0291
)

WM_XXXX window message

View Source
const (
	KEYEVENTF_EXTENDEDKEY = 0x0001
	KEYEVENTF_KEYUP       = 0x0002
	KEYEVENTF_UNICODE     = 0x0004
	KEYEVENTF_SCANCODE    = 0x0008
)

KEYEVENTF

View Source
const (
	INPUT_MOUSE    = 0
	INPUT_KEYBOARD = 1
	INPUT_HARDWARE = 2
)

INPUT

View Source
const (
	CTRL_C_EVENT        = 0
	CTRL_BREAK_EVENT    = 1
	CTRL_CLOSE_EVENT    = 2
	CTRL_LOGOFF_EVENT   = 5
	CTRL_SHUTDOWN_EVENT = 6
)
View Source
const CW_USERDEFAULT = 0x80000000

create window

View Source
const (
	GHND = 0x0042
)

GlobalAlloc

View Source
const INVALID_HANDLE_VALUE uintptr = ^uintptr(0)
View Source
const (
	STD_OUTPUT_HANDLE = 0xFFFFFFF5
)

STD handle

View Source
const (
	WH_KEYBOARD_LL = 13
)

windows hook

Variables

View Source
var (
	GetLastError = findProc(kernel32Dll, "GetLastError")

	RegisterClassExW    = findProc(user32Dll, "RegisterClassExW")
	DefWindowProcW      = findProc(user32Dll, "DefWindowProcW")
	CreateWindowExW     = findProc(user32Dll, "CreateWindowExW")
	DestroyWindow       = findProc(user32Dll, "DestroyWindow")
	GetForegroundWindow = findProc(user32Dll, "GetForegroundWindow")
	SetForegroundWindow = findProc(user32Dll, "SetForegroundWindow")
	SetFocus            = findProc(user32Dll, "SetFocus")
	SetActiveWindow     = findProc(user32Dll, "SetActiveWindow")

	AddClipboardFormatListener    = findProc(user32Dll, "AddClipboardFormatListener")
	RemoveClipboardFormatListener = findProc(user32Dll, "RemoveClipboardFormatListener")
	GetClipboardSequenceNumber    = findProc(user32Dll, "GetClipboardSequenceNumber")
	IsClipboardFormatAvailable    = findProc(user32Dll, "IsClipboardFormatAvailable")
	OpenClipboard                 = findProc(user32Dll, "OpenClipboard")
	CloseClipboard                = findProc(user32Dll, "CloseClipboard")
	GetClipboardData              = findProc(user32Dll, "GetClipboardData")
	SetClipboardData              = findProc(user32Dll, "SetClipboardData")
	EmptyClipboard                = findProc(user32Dll, "EmptyClipboard")

	DragQueryFileW = findProc(shell32Dll, "DragQueryFileW")

	SetWindowsHookExW   = findProc(user32Dll, "SetWindowsHookExW")
	UnhookWindowsHookEx = findProc(user32Dll, "UnhookWindowsHookEx")
	CallNextHookEx      = findProc(user32Dll, "CallNextHookEx")

	GetCurrentThreadId = findProc(kernel32Dll, "GetCurrentThreadId")

	GlobalAlloc           = findProc(kernel32Dll, "GlobalAlloc")
	GlobalFree            = findProc(kernel32Dll, "GlobalFree")
	GlobalLock            = findProc(kernel32Dll, "GlobalLock")
	GlobalUnlock          = findProc(kernel32Dll, "GlobalUnlock")
	GetModuleHandleW      = findProc(kernel32Dll, "GetModuleHandleW")
	GetConsoleWindow      = findProc(kernel32Dll, "GetConsoleWindow")
	GetStdHandle          = findProc(kernel32Dll, "GetStdHandle")
	SetConsoleWindowInfo  = findProc(kernel32Dll, "SetConsoleWindowInfo")
	SetConsoleCtrlHandler = findProc(kernel32Dll, "SetConsoleCtrlHandler")

	GetMessageW      = findProc(user32Dll, "GetMessageW")
	TranslateMessage = findProc(user32Dll, "TranslateMessage")
	DispatchMessageW = findProc(user32Dll, "DispatchMessageW")
	SendMessageW     = findProc(user32Dll, "SendMessageW")
	PostQuitMessage  = findProc(user32Dll, "PostQuitMessage")

	SendInput = findProc(user32Dll, "SendInput")

	CopyMemory = findProc(kernel32Dll, "RtlCopyMemory")
)

functions

Functions

Types

type BOOL

type BOOL = int32

vc++ int = int32

type DWORD

type DWORD = uint32

vc++ int = int32

type HARDWAREINPUT

type HARDWAREINPUT struct {
	Msg    DWORD
	ParamL WORD
	ParamH WORD
}

type HBRUSH

type HBRUSH = uintptr

vc++ int = int32

type HCURSOR

type HCURSOR = uintptr

vc++ int = int32

type HDROP

type HDROP = uintptr

vc++ int = int32

type HHOOK

type HHOOK = uintptr

vc++ int = int32

type HICON

type HICON = uintptr

vc++ int = int32

type HINSTANCE

type HINSTANCE = uintptr

vc++ int = int32

type HWND

type HWND = uintptr

vc++ int = int32

const HWND_MESSAGE HWND = ^HWND(2) // -3

type INPUT

type INPUT struct {
	Type DWORD

	Union [32]byte
	// contains filtered or unexported fields
}

type KBDLLHOOKSTRUCT

type KBDLLHOOKSTRUCT struct {
	VkCode    DWORD
	ScanCode  DWORD
	Flags     DWORD
	Time      DWORD
	ExtraInfo uintptr
}

type KEYBDINPUT

type KEYBDINPUT struct {
	VK        WORD
	Scan      WORD
	Flags     DWORD
	Time      DWORD
	ExtraInfo ULONG_PTR
}

type LONG

type LONG = int32

vc++ int = int32

type LPARAM

type LPARAM = uintptr

vc++ int = int32

type LPCWSTR

type LPCWSTR = *uint16

vc++ int = int32

type LRESULT

type LRESULT = uintptr

vc++ int = int32

type MOUSEINPUT

type MOUSEINPUT struct {
	DX        LONG
	DY        LONG
	MouseData DWORD
	Flags     DWORD
	Time      DWORD
	ExtraInfo ULONG_PTR
}

type MSG

type MSG struct {
	Hwnd    HWND
	Message UINT
	WParam  WPARAM
	LParam  LPARAM
	Time    DWORD
	Point   POINT
	Private DWORD
}

type POINT

type POINT struct {
	X LONG
	Y LONG
}

type SHORT

type SHORT = int16

vc++ int = int32

type SMALL_RECT

type SMALL_RECT struct {
	Left   SHORT
	Top    SHORT
	Right  SHORT
	Bottom SHORT
}

type UINT

type UINT = uint32

vc++ int = int32

type ULONG

type ULONG = uint32

vc++ int = int32

type ULONG_PTR

type ULONG_PTR = uint64

vc++ int = int32

type USHORT

type USHORT = uint16

vc++ int = int32

type WNDCLASSEXW

type WNDCLASSEXW struct {
	Size       UINT
	Style      UINT
	WndProc    WNDPROC
	ClsExtra   int32
	WndExtra   int32
	Instance   HINSTANCE
	Icon       HICON
	Cursor     HCURSOR
	Background HBRUSH
	MenuName   LPCWSTR
	ClassName  LPCWSTR
	IconSm     HICON
}

type WNDPROC

type WNDPROC = uintptr

vc++ int = int32

type WORD

type WORD = uint16

vc++ int = int32

type WPARAM

type WPARAM = uintptr

vc++ int = int32

Jump to

Keyboard shortcuts

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