|
-
Nov 9th, 1999, 10:21 PM
#1
Thread Starter
New Member
Hi All,
I've not been for a while, but now come seeking help and knowing you are all so wonderful, hope you can help me (Yes I am creeping!!)
I am in the middle of writing a fairly simple run-of-the-mill app to make my day easier, but When I minimize it, I want it to go into the Sys tray(The little thingy on the toolbar where the clock is - I think it's the systray anyway!). How can I do this? I'm sure it's been done before, but I can't find the code
TIA
Ell
-
Nov 9th, 1999, 11:05 PM
#2
Junior Member
I think this article might give you some ideas:
http://www.vb-world.net/tips/tip61.html
-
Nov 9th, 1999, 11:07 PM
#3
New Member
Check out the artical called: How to add an icon to the tray, on this site, which will add the icon to the taskbar tray. You will then need to hide your form and then transfer control to the little icon.
-
Nov 9th, 1999, 11:19 PM
#4
Like this:
Add an Invisible Picturebox to your Form..
Code:
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 Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long
Private Const NIF_ICON = &H2
Private Const NIF_MESSAGE = &H1
Private Const NIF_TIP = &H4
Private Const NIM_ADD = &H0
Private Const NIM_DELETE = &H2
Private Const WM_MOUSEMOVE = &H200
Private tTrayIcon As NOTIFYICONDATA
Private Sub Form_Load()
With tTrayIcon
.hIcon = Icon
.hwnd = Picture1.hwnd
.szTip = Caption & Chr(0)
.uCallbackMessage = WM_MOUSEMOVE
.uFlags = NIF_ICON Or NIF_MESSAGE Or NIF_TIP
.uID = 1
.cbSize = Len(tTrayIcon)
End With
End Sub
Private Sub Form_Resize()
If WindowState = vbMinimized Then
Hide
Shell_NotifyIcon NIM_ADD, tTrayIcon
End If
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Right(Hex(X), 1) = "D" Then
WindowState = vbNormal
Show
Shell_NotifyIcon NIM_DELETE, tTrayIcon
End If
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
[This message has been edited by Aaron Young (edited 11-10-1999).]
-
Nov 9th, 1999, 11:26 PM
#5
Thread Starter
New Member
Thank you both very much, This should do the trick!!
Ell
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
|