2022-06-17 22:45:49 -04:00
|
|
|
//go:build windows
|
|
|
|
|
|
|
|
package win
|
|
|
|
|
|
|
|
const (
|
2022-06-19 21:14:08 -04:00
|
|
|
BIF_RETURNONLYFSDIRS = 0x00000001
|
|
|
|
|
|
|
|
BFFM_INITIALIZED = 1
|
|
|
|
BFFM_SETSELECTION = WM_USER + 103
|
|
|
|
|
2022-06-17 22:45:49 -04:00
|
|
|
NIM_ADD = 0
|
|
|
|
NIM_DELETE = 2
|
|
|
|
)
|
|
|
|
|
|
|
|
// https://docs.microsoft.com/en-us/windows/win32/api/shlobj_core/ns-shlobj_core-browseinfow
|
|
|
|
type BROWSEINFO struct {
|
2022-06-18 07:37:39 -04:00
|
|
|
Owner HWND
|
2022-06-19 21:14:08 -04:00
|
|
|
Root Pointer
|
2022-06-17 22:45:49 -04:00
|
|
|
DisplayName *uint16
|
|
|
|
Title *uint16
|
|
|
|
Flags uint32
|
|
|
|
CallbackFunc uintptr
|
|
|
|
LParam *uint16
|
|
|
|
Image int32
|
|
|
|
}
|
|
|
|
|
|
|
|
// https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-notifyicondataw
|
|
|
|
type NOTIFYICONDATA struct {
|
|
|
|
StructSize uint32
|
2022-06-18 07:37:39 -04:00
|
|
|
Wnd HWND
|
2022-06-17 22:45:49 -04:00
|
|
|
ID uint32
|
|
|
|
Flags uint32
|
|
|
|
CallbackMessage uint32
|
2022-06-18 07:37:39 -04:00
|
|
|
Icon Handle
|
2022-06-17 22:45:49 -04:00
|
|
|
Tip [128]uint16 // NOTIFYICONDATAA_V1_SIZE
|
|
|
|
State uint32
|
|
|
|
StateMask uint32
|
|
|
|
Info [256]uint16
|
|
|
|
Version uint32
|
|
|
|
InfoTitle [64]uint16
|
|
|
|
InfoFlags uint32
|
2022-06-18 07:37:39 -04:00
|
|
|
// GuidItem [16]byte // NOTIFYICONDATAA_V2_SIZE
|
|
|
|
// BalloonIcon Handle // NOTIFYICONDATAA_V3_SIZE
|
2022-06-17 22:45:49 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
type IShellItem struct {
|
|
|
|
COMObject
|
|
|
|
*_IShellItemVtbl
|
|
|
|
}
|
|
|
|
|
|
|
|
type _IShellItemVtbl struct {
|
|
|
|
IUnknownVtbl
|
|
|
|
BindToHandler uintptr
|
|
|
|
GetParent uintptr
|
|
|
|
GetDisplayName uintptr
|
|
|
|
GetAttributes uintptr
|
|
|
|
Compare uintptr
|
|
|
|
}
|
|
|
|
|
2022-06-20 08:37:28 -04:00
|
|
|
//sys SHBrowseForFolder(bi *BROWSEINFO) (ret unsafe.Pointer) = shell32.SHBrowseForFolder
|
2022-06-18 11:12:03 -04:00
|
|
|
//sys SHCreateItemFromParsingName(path *uint16, bc unsafe.Pointer, iid uintptr, item **IShellItem) (res error) = shell32.SHCreateItemFromParsingName
|
2022-06-17 22:45:49 -04:00
|
|
|
//sys ShellNotifyIcon(message uint32, data *NOTIFYICONDATA) (ret int, err error) = shell32.Shell_NotifyIconW
|
2022-06-20 08:37:28 -04:00
|
|
|
//sys SHGetPathFromIDListEx(ptr unsafe.Pointer, path *uint16, pathLen int, opts int) (ok bool) = shell32.SHGetPathFromIDListEx
|