Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
* eol=lf

*.cmd eol=crlf
*.bat eol=crlf

*.syso binary
*.gif binary
*.png binary
*.jpg binary
*.ico binary
*.zip binary
*.ttf binary
*.otf binary
*.woff binary
*.eot binary
*.pdf binary
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/lxn/win

go 1.12

require golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13
require golang.org/x/sys v0.1.0
13 changes: 13 additions & 0 deletions user32.go
Original file line number Diff line number Diff line change
Expand Up @@ -1857,6 +1857,7 @@ var (
postQuitMessage *windows.LazyProc
redrawWindow *windows.LazyProc
registerClassEx *windows.LazyProc
registerHotKey *windows.LazyProc
registerRawInputDevices *windows.LazyProc
registerWindowMessage *windows.LazyProc
releaseCapture *windows.LazyProc
Expand Down Expand Up @@ -2012,6 +2013,7 @@ func init() {
postQuitMessage = libuser32.NewProc("PostQuitMessage")
redrawWindow = libuser32.NewProc("RedrawWindow")
registerClassEx = libuser32.NewProc("RegisterClassExW")
registerHotKey = libuser32.NewProc("RegisterHotKey")
registerRawInputDevices = libuser32.NewProc("RegisterRawInputDevices")
registerWindowMessage = libuser32.NewProc("RegisterWindowMessageW")
releaseCapture = libuser32.NewProc("ReleaseCapture")
Expand Down Expand Up @@ -3091,6 +3093,17 @@ func RegisterClassEx(windowClass *WNDCLASSEX) ATOM {
return ATOM(ret)
}

func RegisterHotKey(hwnd HWND, id int, fsModifiers, vk uint) bool {
ret, _, _ := syscall.Syscall6(registerHotKey.Addr(), 4,
uintptr(hwnd),
uintptr(id),
uintptr(fsModifiers),
uintptr(vk),
0,
0)
return ret != 0
}

func RegisterRawInputDevices(pRawInputDevices *RAWINPUTDEVICE, uiNumDevices uint32, cbSize uint32) bool {
ret, _, _ := syscall.Syscall(registerRawInputDevices.Addr(), 3,
uintptr(unsafe.Pointer(pRawInputDevices)),
Expand Down