Skip to content

Commit 6d12498

Browse files
committed
XP doesn't have AddClipboardFormatListener either
1 parent 2b1cddc commit 6d12498

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

user32.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,7 @@ func init() {
16011601
libuser32 = MustLoadLibrary("user32.dll")
16021602

16031603
// Functions
1604-
addClipboardFormatListener = MustGetProcAddress(libuser32, "AddClipboardFormatListener")
1604+
addClipboardFormatListener, _ = syscall.GetProcAddress(syscall.Handle(libuser32), "AddClipboardFormatListener")
16051605
adjustWindowRect = MustGetProcAddress(libuser32, "AdjustWindowRect")
16061606
beginDeferWindowPos = MustGetProcAddress(libuser32, "BeginDeferWindowPos")
16071607
beginPaint = MustGetProcAddress(libuser32, "BeginPaint")
@@ -1722,6 +1722,10 @@ func init() {
17221722
}
17231723

17241724
func AddClipboardFormatListener(hwnd HWND) bool {
1725+
if addClipboardFormatListener == 0 {
1726+
return false
1727+
}
1728+
17251729
ret, _, _ := syscall.Syscall(addClipboardFormatListener, 1,
17261730
uintptr(hwnd),
17271731
0,

0 commit comments

Comments
 (0)