hello, me again ^^;, I have another problem, I want my program to have the ability to hide in the system tray, is this possible, if it is, can you please give me a code for this?, thanks in advance , more power
: hello, me again ^^;, I have another problem, I want my program to have the ability to hide in the system tray, is this possible, if it is, can you please give me a code for this?, thanks in advance , more power : : Hi, this is part of my old code adding system tray. [code]'SystemTray Dim TrayIcon As NOTIFYICONDATA Dim retVal As Long With TrayIcon .cbSize = Len(TrayIcon) .hWnd = Me.hWnd .uID = Me.Icon .uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP .uCallbackMessage = WM_MOUSEMOVE .hIcon = Me.Icon .szTip = "My Aplication" & Chr(0) End With retVal = Shell_NotifyIcon(NIM_ADD, TrayIcon) 'Add icon ... [green]'Do not forget to remove the icon on un load![/green] Dim TrayIcon As NOTIFYICONDATA Dim retVal As Long With TrayIcon .cbSize = Len(TrayIcon) .hWnd = Me.hWnd .uID = Me.Icon .uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP .uCallbackMessage = WM_MOUSEMOVE .hIcon = Me.Icon .szTip = "My application" End With retVal = Shell_NotifyIcon(NIM_DELETE, TrayIcon)[/code] ..popup menu and global shortcuts gives little more work.. This is part witch raised some code when I clicked the icon.. [code]Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Dim lMsg As Long lMsg = X / Screen.TwipsPerPixelX Select Case lMsg Case WM_LBUTTONDOWN [green]'Do some action here, I've used to pop-up local menu[/green] Me.PopupMenu mnuItemSysTray End Select End Sub[/code]
: : hello, me again ^^;, I have another problem, I want my program to have the ability to hide in the system tray, is this possible, if it is, can you please give me a code for this?, thanks in advance , more power : : : : : Hi, : this is part of my old code adding system tray. : [code]'SystemTray : Dim TrayIcon As NOTIFYICONDATA : Dim retVal As Long : With TrayIcon : .cbSize = Len(TrayIcon) : .hWnd = Me.hWnd : .uID = Me.Icon : .uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP : .uCallbackMessage = WM_MOUSEMOVE : .hIcon = Me.Icon : .szTip = "My Aplication" & Chr(0) : End With : retVal = Shell_NotifyIcon(NIM_ADD, TrayIcon) 'Add icon : ... : [green]'Do not forget to remove the icon on un load![/green] : Dim TrayIcon As NOTIFYICONDATA : Dim retVal As Long : With TrayIcon : .cbSize = Len(TrayIcon) : .hWnd = Me.hWnd : .uID = Me.Icon : .uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP : .uCallbackMessage = WM_MOUSEMOVE : .hIcon = Me.Icon : .szTip = "My application" : End With : retVal = Shell_NotifyIcon(NIM_DELETE, TrayIcon)[/code] : ..popup menu and global shortcuts gives little more work.. : This is part witch raised some code when I clicked the icon.. : [code]Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) : Dim lMsg As Long : lMsg = X / Screen.TwipsPerPixelX : Select Case lMsg : Case WM_LBUTTONDOWN : [green]'Do some action here, I've used to pop-up local menu[/green] : Me.PopupMenu mnuItemSysTray : End Select : End Sub[/code] : : Hope this helps : : [blue][b][italic][size=4]P[/size]avlin [size=4]II[/italic][/size][/b][/blue] : : [purple]Don't take life too seriously anyway you won't escape alive from it![/purple] : : : Thank you very much, You're a great programmer indeed ^_^
"A mind is a teribble thing to waste" -Yuri's revenge
Comments
:
:
Hi,
this is part of my old code adding system tray.
[code]'SystemTray
Dim TrayIcon As NOTIFYICONDATA
Dim retVal As Long
With TrayIcon
.cbSize = Len(TrayIcon)
.hWnd = Me.hWnd
.uID = Me.Icon
.uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP
.uCallbackMessage = WM_MOUSEMOVE
.hIcon = Me.Icon
.szTip = "My Aplication" & Chr(0)
End With
retVal = Shell_NotifyIcon(NIM_ADD, TrayIcon) 'Add icon
...
[green]'Do not forget to remove the icon on un load![/green]
Dim TrayIcon As NOTIFYICONDATA
Dim retVal As Long
With TrayIcon
.cbSize = Len(TrayIcon)
.hWnd = Me.hWnd
.uID = Me.Icon
.uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP
.uCallbackMessage = WM_MOUSEMOVE
.hIcon = Me.Icon
.szTip = "My application"
End With
retVal = Shell_NotifyIcon(NIM_DELETE, TrayIcon)[/code]
..popup menu and global shortcuts gives little more work..
This is part witch raised some code when I clicked the icon..
[code]Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim lMsg As Long
lMsg = X / Screen.TwipsPerPixelX
Select Case lMsg
Case WM_LBUTTONDOWN
[green]'Do some action here, I've used to pop-up local menu[/green]
Me.PopupMenu mnuItemSysTray
End Select
End Sub[/code]
Hope this helps
[blue][b][italic][size=4]P[/size]avlin [size=4]II[/italic][/size][/b][/blue]
[purple]Don't take life too seriously anyway you won't escape alive from it![/purple]
: :
: :
: Hi,
: this is part of my old code adding system tray.
: [code]'SystemTray
: Dim TrayIcon As NOTIFYICONDATA
: Dim retVal As Long
: With TrayIcon
: .cbSize = Len(TrayIcon)
: .hWnd = Me.hWnd
: .uID = Me.Icon
: .uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP
: .uCallbackMessage = WM_MOUSEMOVE
: .hIcon = Me.Icon
: .szTip = "My Aplication" & Chr(0)
: End With
: retVal = Shell_NotifyIcon(NIM_ADD, TrayIcon) 'Add icon
: ...
: [green]'Do not forget to remove the icon on un load![/green]
: Dim TrayIcon As NOTIFYICONDATA
: Dim retVal As Long
: With TrayIcon
: .cbSize = Len(TrayIcon)
: .hWnd = Me.hWnd
: .uID = Me.Icon
: .uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP
: .uCallbackMessage = WM_MOUSEMOVE
: .hIcon = Me.Icon
: .szTip = "My application"
: End With
: retVal = Shell_NotifyIcon(NIM_DELETE, TrayIcon)[/code]
: ..popup menu and global shortcuts gives little more work..
: This is part witch raised some code when I clicked the icon..
: [code]Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
: Dim lMsg As Long
: lMsg = X / Screen.TwipsPerPixelX
: Select Case lMsg
: Case WM_LBUTTONDOWN
: [green]'Do some action here, I've used to pop-up local menu[/green]
: Me.PopupMenu mnuItemSysTray
: End Select
: End Sub[/code]
:
: Hope this helps
:
: [blue][b][italic][size=4]P[/size]avlin [size=4]II[/italic][/size][/b][/blue]
:
: [purple]Don't take life too seriously anyway you won't escape alive from it![/purple]
:
:
:
Thank you very much, You're a great programmer indeed ^_^
"A mind is a teribble thing to waste"
-Yuri's revenge