Jump to content

Traytip remove unwanted content & custom icon


Iraj
 Share

Recommended Posts

Hi Team,

Greetings!

I need to embed traytip in some autoit code where I dont need highlighted unwanted content & also can I have a custom logo instead of the presets.

Thanks!

 

#include <TrayConstants.au3>
TrayTip("TrayTip Title", "TrayTip Content", 2, $TIP_ICONASTERISK)

 

traytip_issue.png

Edited by Iraj
Link to comment
Share on other sites

Your png is not available...But I believe this is what you are looking for :

#NoTrayIcon
#include <APIShellExConstants.au3>
#include <WinAPIShellEx.au3>

Opt("MustDeclareVars", True)

Local $tNOTIFYICONDATA = DllStructCreate($tagNOTIFYICONDATA_V4)

OnAutoItExitRegister(OnAutoItExit)

DllStructSetData($tNOTIFYICONDATA, 'Size', DllStructGetSize($tNOTIFYICONDATA))
DllStructSetData($tNOTIFYICONDATA, 'hWnd', WinGetHandle(AutoItWinGetTitle()))
DllStructSetData($tNOTIFYICONDATA, 'Flags', $NIF_ICON + $NIF_TIP)
$tNOTIFYICONDATA.tip = "Test"
$tNOTIFYICONDATA.Version = 4

DllStructSetData($tNOTIFYICONDATA, 'ID', 2)
DllStructSetData($tNOTIFYICONDATA, 'hIcon', _WinAPI_ShellExtractIcon(@SystemDir & '\shell32.dll', 166, 16, 16))
_WinAPI_ShellNotifyIcon($NIM_ADD, $tNOTIFYICONDATA)

Sleep(5000)

DllStructSetData($tNOTIFYICONDATA, 'Flags', $NIF_INFO)
$tNOTIFYICONDATA.Info = "Info 256 bytes"
$tNOTIFYICONDATA.InfoTitle = "Info title 64 bytes"
$tNOTIFYICONDATA.InfoFlags = $NIIF_USER ; user icon
DllStructSetData($tNOTIFYICONDATA, 'hBalloonIcon', _WinAPI_ShellExtractIcon(@SystemDir & '\shell32.dll', 130, 16, 16))
_WinAPI_ShellNotifyIcon($NIM_MODIFY, $tNOTIFYICONDATA)

Sleep (10000)

Func OnAutoItExit()
    DllStructSetData($tNOTIFYICONDATA, 'ID', 2)
    _WinAPI_ShellNotifyIcon($NIM_DELETE, $tNOTIFYICONDATA)
EndFunc   ;==>OnAutoItExit

 

Edited by Nine
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...