Valhalla Legends Forums Archive | General Programming | how do you minimize to the system tray? (VB)

AuthorMessageTime
OcTaViuS
ive searched all over the forums, and while finding threads about this topic, none of them really explained how to do it.

one code example was the way to just minimize it to the taskbar

WindowState = vbMinimized

but i already knew that :-\

so can someone explain how to actually get it to minimize so the icon's in the sytem tray, i can't figure it out, i feel so stupid :'(
April 19, 2003, 8:37 PM
Skywing
[quote author=OcTaViuS link=board=5;threadid=1107;start=0#msg8099 date=1050784641]
ive searched all over the forums, and while finding threads about this topic, none of them really explained how to do it.

one code example was the way to just minimize it to the taskbar

WindowState = vbMinimized

but i already knew that :-\

so can someone explain how to actually get it to minimize so the icon's in the sytem tray, i can't figure it out, i feel so stupid :'(
[/quote]
"Minimizing to the system tray" just means that you hide the window and create a tray icon, which has been covered. This might clear up some confusion...
April 19, 2003, 8:55 PM
OcTaViuS
oooo k that did clear it up a bit

i got the window hiding thing down, but how do u put the icon in the system tray?
April 19, 2003, 11:13 PM
Grok
You search the forums for 'system tray'.
April 19, 2003, 11:21 PM
OcTaViuS
heh thanks :-\ turns out when i searched b4 posting this thread i didnt search far enough back, i had to extend the max age of post thing. i got it now thanks guys.
April 19, 2003, 11:38 PM
Dayclone
heres the code

Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long

Public 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

'constants required by Shell_NotifyIcon API call:
Public Const NIM_ADD = &H0
Public Const NIM_MODIFY = &H1
Public Const NIM_DELETE = &H2
Public Const NIF_MESSAGE = &H1
Public Const NIF_ICON = &H2
Public Const NIF_TIP = &H4
Public Const WM_MOUSEMOVE = &H200
Public Const WM_LBUTTONDOWN = &H201 'Button down
Public Const WM_LBUTTONUP = &H202 'Button up
Public Const WM_LBUTTONDBLCLK = &H203 'Double-click
Public Const WM_RBUTTONDOWN = &H204 'Button down
Public Const WM_RBUTTONUP = &H205 'Button up
Public Const WM_RBUTTONDBLCLK = &H206 'Double-click

Public Declare Function SetForegroundWindow Lib "user32" _
(ByVal hwnd As Long) As Long

Public nid As NOTIFYICONDATA
April 20, 2003, 12:44 AM
haZe
Those are just declares.
April 20, 2003, 11:17 AM

Search