Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for custom balloon icon #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 3 additions & 4 deletions kernel32.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ func init() {
mulDiv = MustGetProcAddress(libkernel32, "MulDiv")
setLastError = MustGetProcAddress(libkernel32, "SetLastError")
systemTimeToFileTime = MustGetProcAddress(libkernel32, "SystemTimeToFileTime")

}

func CloseHandle(hObject HANDLE) bool {
Expand Down Expand Up @@ -264,12 +263,12 @@ func GetThreadUILanguage() LANGID {
return LANGID(ret)
}

func GetVersion() int64 {
func GetVersion() uint32 {
ret, _, _ := syscall.Syscall(getVersion, 0,
0,
0,
0)
return int64(ret)
return uint32(ret)
}

func GlobalAlloc(uFlags uint32, dwBytes uintptr) HGLOBAL {
Expand Down Expand Up @@ -338,4 +337,4 @@ func SystemTimeToFileTime(lpSystemTime *SYSTEMTIME, lpFileTime *FILETIME) bool {
0)

return ret != 0
}
}
8 changes: 7 additions & 1 deletion shell32.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ const (
NIIF_NOSOUND = 0x00000010
)

const NOTIFYICON_VERSION = 3
const NOTIFYICON_VERSION_XP uint32 = 0x3
const NOTIFYICON_VERSION_VISTA uint32 = 0x4

// SHGetFileInfo flags
const (
Expand Down Expand Up @@ -152,6 +153,11 @@ type NOTIFYICONDATA struct {
SzInfoTitle [64]uint16
DwInfoFlags uint32
GuidItem syscall.GUID
hBalloonIcon HICON
}

func (nid *NOTIFYICONDATA) Set_hBalloonIcon(icon HICON) {
nid.hBalloonIcon = icon
}

type SHFILEINFO struct {
Expand Down