Solved

minimizing a window on close

Posted on 2002-07-29
4
151 Views
Last Modified: 2010-05-18
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.
0
Comment
Question by:chintamanidhotre
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
sanjaykattimani earned 100 total points
ID: 7184901
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
 
LVL 15

Expert Comment

by:mohan_sekar
ID: 7184902
Hi,

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

bye

Mohan
0
 

Author Comment

by:chintamanidhotre
ID: 7184923
Thanks sanjay for the prompt and correct answer.
0
 
LVL 3

Expert Comment

by:sanjaykattimani
ID: 7184956
:) My pleasure.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now