Documentation ¶
Rendered for windows/amd64
Index ¶
- Constants
- Variables
- func MakeIntResource(id uint16) *uint16
- func NewIconFromFile(filePath string) (uintptr, error)
- type HANDLE
- type HBRUSH
- type HCURSOR
- type HGDIOBJ
- type HICON
- type HINSTANCE
- type HMENU
- type HWND
- type MSG
- type MenuItem
- type NOTIFYICONDATA
- type POINT
- type Systray
- func (p *Systray) AppendMenu(label string, onclick func())
- func (p *Systray) AppendSeparator()
- func (p *Systray) HWND() HWND
- func (p *Systray) OnClick(fn func())
- func (p *Systray) OnRightClick(fn func())
- func (p *Systray) Run() error
- func (p *Systray) SetIcon(hicon HICON) error
- func (p *Systray) SetTooltip(tooltip string) error
- func (p *Systray) SetVisible(visible bool) error
- func (p *Systray) Show(iconResID uint16, hint string) error
- func (p *Systray) ShowCustom(file string, hint string) error
- func (p *Systray) ShowMessage(title, msg string, bigIcon bool) error
- func (p *Systray) Stop() error
- func (p *Systray) WinProc(hwnd HWND, msg uint32, wparam, lparam uintptr) uintptr
- type WNDCLASSEX
- type WindowProc
Constants ¶
View Source
const ( WM_LBUTTONUP = 0x0202 WM_LBUTTONDBLCLK = 0x0203 WM_RBUTTONUP = 0x0205 WM_USER = 0x0400 WM_TRAYICON = WM_USER + 69 WS_EX_APPWINDOW = 0x00040000 WS_OVERLAPPEDWINDOW = 0x00000000 | 0x00C00000 | 0x00080000 | 0x00040000 | 0x00020000 | 0x00010000 CW_USEDEFAULT = 0x80000000 NIM_ADD = 0x00000000 NIM_MODIFY = 0x00000001 NIM_DELETE = 0x00000002 NIM_SETVERSION = 0x00000004 NIF_MESSAGE = 0x00000001 NIF_ICON = 0x00000002 NIF_TIP = 0x00000004 NIF_STATE = 0x00000008 NIF_INFO = 0x00000010 NIS_HIDDEN = 0x00000001 NIIF_NONE = 0x00000000 NIIF_INFO = 0x00000001 NIIF_WARNING = 0x00000002 NIIF_ERROR = 0x00000003 NIIF_USER = 0x00000004 NIIF_NOSOUND = 0x00000010 NIIF_LARGE_ICON = 0x00000020 NIIF_RESPECT_QUIET_TIME = 0x00000080 NIIF_ICON_MASK = 0x0000000F IMAGE_BITMAP = 0 IMAGE_ICON = 1 LR_LOADFROMFILE = 0x00000010 LR_DEFAULTSIZE = 0x00000040 IDC_ARROW = 32512 COLOR_WINDOW = 5 COLOR_BTNFACE = 15 GWLP_USERDATA = -21 WS_CLIPSIBLINGS = 0x04000000 WS_EX_CONTROLPARENT = 0x00010000 HWND_MESSAGE = ^HWND(2) NOTIFYICON_VERSION = 4 IDI_APPLICATION = 32512 WM_APP = 32768 WM_COMMAND = 273 MenuItemMsgID = WM_APP + 1024 NotifyIconMessageId = WM_APP + iota MF_STRING = 0x00000000 MF_ENABLED = 0x00000000 MF_GRAYED = 0x00000001 MF_DISABLED = 0x00000002 MF_SEPARATOR = 0x00000800 MF_CHECKED = 0x00000008 MF_MENUBARBREAK = 0x00000020 TPM_LEFTALIGN = 0x0000 WM_NULL = 0 )
Variables ¶
View Source
var ( GetModuleHandle = kernel32.MustFindProc("GetModuleHandleW") GetConsoleWindow = kernel32.MustFindProc("GetConsoleWindow") GetLastError = kernel32.MustFindProc("GetLastError") Shell_NotifyIcon = shell32.MustFindProc("Shell_NotifyIconW") GetMessage = user32.MustFindProc("GetMessageW") IsDialogMessage = user32.MustFindProc("IsDialogMessageW") TranslateMessage = user32.MustFindProc("TranslateMessage") DispatchMessage = user32.MustFindProc("DispatchMessageW") ShowWindow = user32.MustFindProc("ShowWindow") UpdateWindow = user32.MustFindProc("UpdateWindow") DefWindowProc = user32.MustFindProc("DefWindowProcW") RegisterClassEx = user32.MustFindProc("RegisterClassExW") GetDesktopWindow = user32.MustFindProc("GetDesktopWindow") CreateWindowEx = user32.MustFindProc("CreateWindowExW") CreatePopupMenu = user32.MustFindProc("CreatePopupMenu") LoadImage = user32.MustFindProc("LoadImageW") LoadIcon = user32.MustFindProc("LoadIconW") LoadCursor = user32.MustFindProc("LoadCursorW") )
Functions ¶
func MakeIntResource ¶
func NewIconFromFile ¶
Types ¶
type HINSTANCE ¶
type HINSTANCE HANDLE
func RegisterWindow ¶
func RegisterWindow(name string, proc WindowProc) (HINSTANCE, error)
type NOTIFYICONDATA ¶
type Systray ¶
type Systray struct { Menu []*MenuItem // contains filtered or unexported fields }
func (*Systray) AppendMenu ¶
AppendMenu add menu item.
func (*Systray) OnRightClick ¶
func (p *Systray) OnRightClick(fn func())
func (*Systray) SetTooltip ¶
func (*Systray) SetVisible ¶
func (*Systray) ShowCustom ¶
ShowCustom shows custom tray icon.
type WNDCLASSEX ¶
Click to show internal directories.
Click to hide internal directories.