How can add image in system tray menu something like sidebar(verticle image)?.. is there any sample .. plz help
Printable View
How can add image in system tray menu something like sidebar(verticle image)?.. is there any sample .. plz help
do a search for SysTray or System Tray, you'll find tonnes of hits
Here is an example. I have not tested it because my college does not have Vb installed yet, so i am current stuck with office, there forms do not support icons or hWnd so.
Here is the code as far as i remember it. i has been a long time since i have used it.
VB Code:
Option Explicit Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" ( _ ByVal dwMessage As Long, _ pnid As NOTIFYICONDATA) _ As Long Private Type NOTIFYICONDATA cbSize As Long hWnd As Long uId As Long uFlags As Long ucallbackMessage As Long hIcon As Long szTip As String * 64 End Type Private Const NIM_ADD = &H0 Private Const NIM_MODIFY = &H1 Private Const NIM_DELETE = &H2 Private Const NIF_MESSAGE = &H1 Private Const NIF_ICON = &H2 Private Const NIF_TIP = &H4 Private Const WM_LBUTTONDBLCLK = &H203 Private Const WM_LBUTTONDOWN = &H201 Private Const WM_RBUTTONUP = &H205 Private Sub Form_Load() Dim NID As NOTIFYICONDATA 'Set the data With NID .cbSize = Len(NID) .hIcon = Me.Icon .hWnd = Me.hWnd .szTip = "Tray Application" & vbNullChar .ucallbackMessage = WM_LBUTTONDBLCLK .uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP .uId = 1& End With 'Add the Icon Shell_NotifyIcon NIM_ADD, NID End Sub Private Sub Command1_Click() Shell_NotifyIcon NIM_DELETE, NID End Sub
Hope this helps
Jenova
Thanks Jenova for the help but i want something else your code is simple tray menu sample but I want image in left side vertical image … there are sample for menu but not for tray menu…. :(
I want something like this
http://www.vbaccelerator.com/home/vb...e/icqpmenu.gif
but this is not tray menu
a systray menu isn't any different to a normal menu - so just use the vbAccelerator code