From 9b003f3e9d1da0ea354a04198354ec9a263cb9ef Mon Sep 17 00:00:00 2001 From: Starainrt Date: Tue, 26 Mar 2024 14:26:49 +0800 Subject: [PATCH] update clipboard func --- shell32.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/shell32.go b/shell32.go index afac602..0a9e75f 100644 --- a/shell32.go +++ b/shell32.go @@ -86,3 +86,17 @@ func ShellExecuteEx(muzika *SHELLEXECUTEINFOW) error { } return nil } + +func DragQueryFile(hDrop HDROP, iFile DWORD, lpszFile *uint16, cch DWORD) (DWORD, error) { + shell32, err := syscall.LoadLibrary("shell32.dll") + if err != nil { + return 0, err + } + defer syscall.FreeLibrary(shell32) + dqf, err := syscall.GetProcAddress(syscall.Handle(shell32), "DragQueryFileW") + if err != nil { + return 0, err + } + r, _, _ := syscall.Syscall6(dqf, 4, uintptr(hDrop), uintptr(iFile), uintptr(unsafe.Pointer(lpszFile)), uintptr(cch), 0, 0) + return DWORD(r), nil +}