minimizing a window on close

Hi,

How to minimize (keep the form active) even after u have pressed the closed button.
Just like in MSN or Yahoo messenger when ever u press the close button...the form doesnt get unloaded but it remains active in the System tray.

Thanks in advance.

Chintamani.
chintamanidhotreAsked:
Who is Participating?
 
sanjaykattimaniConnect With a Mentor Commented:
Write the following in form's query unload event it'll b minimized


Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Cancel = 1          'Avoids closing of the window
Me.WindowState = 1  'Minimizes the window
End Sub

0
 
mohan_sekarCommented:
Hi,

     Try using ShellNotifyIcon API to load ur form in the system tray.

bye

Mohan
0
 
chintamanidhotreAuthor Commented:
Thanks sanjay for the prompt and correct answer.
0
 
sanjaykattimaniCommented:
:) My pleasure.
0
All Courses

From novice to tech pro — start learning today.