• Welcome to Valhalla Legends Archive.
 

how do you minimize to the system tray? (VB)

Started by OcTaViuS, April 19, 2003, 03:37 PM

Previous topic - Next topic

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  :'(

Skywing

Quote from: OcTaViuS on April 19, 2003, 03:37 PM
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  :'(
"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...

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?

Grok

#3
You search the forums for 'system tray'.

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.

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

haZe