|
-
Sep 12th, 2006, 05:43 AM
#1
Thread Starter
Lively Member
System tray
How can add image in system tray menu something like sidebar(verticle image)?.. is there any sample .. plz help
-
Sep 12th, 2006, 05:46 AM
#2
Re: System tray
do a search for SysTray or System Tray, you'll find tonnes of hits
-
Sep 12th, 2006, 05:54 AM
#3
Re: System tray
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
-
Sep 12th, 2006, 06:27 AM
#4
Thread Starter
Lively Member
Re: System tray
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
Last edited by xor83; Sep 12th, 2006 at 07:46 AM.
-
Sep 12th, 2006, 06:32 AM
#5
Re: System tray
a systray menu isn't any different to a normal menu - so just use the vbAccelerator code
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|