-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdll_shell32_windows.go
42 lines (34 loc) · 1.33 KB
/
dll_shell32_windows.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// -----------------------------------------------------------------------------
// ZR Library: Windows 32 API zr-win/[dll_shell32_windows.go]
// (c) [email protected] License: MIT
// -----------------------------------------------------------------------------
package win
import (
"syscall"
"unsafe"
)
var (
shell32 = syscall.NewLazyDLL("shell32.dll")
shellDragAcceptFiles = shell32.NewProc("DragAcceptFiles")
shellDragFinish = shell32.NewProc("DragFinish")
shellDragQueryFile = shell32.NewProc("DragQueryFileW")
)
// DragAcceptFiles shell32.dll
func DragAcceptFiles(hWnd HWND, fAccept BOOL) {
shellDragAcceptFiles.Call(uintptr(hWnd), uintptr(fAccept))
} // DragAcceptFiles
// DragFinish library: shell32.dll
func DragFinish(hDrop HDROP) {
shellDragFinish.Call(uintptr(hDrop))
} // DragFinish
// DragQueryFile library: shell32.dll
func DragQueryFile(hDrop HDROP, iFile UINT, lpszFile LPTSTR, cch UINT) UINT {
ret, _, _ := shellDragQueryFile.Call(
uintptr(hDrop),
uintptr(iFile),
uintptr(unsafe.Pointer(lpszFile)),
uintptr(cch),
)
return UINT(ret)
} // DragQueryFile
// end