DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Minimize app to Systray

  1. #1
    Join Date
    Apr 2005
    Location
    South Africa
    Posts
    88

    Exclamation Minimize app to Systray

    Hi there,
    My app is already loaded in the systray the only thing I wanna know is how do you minimize the app so that it is only visible in the systray not the taskbar, by clicking on the forms minimize button and then I have a restore button under my systray menu.
    Basically I want to know how to program the Forms minimize button.

    Regards
    GermanD

  2. #2
    Join Date
    Feb 2004
    Location
    Colton, CA
    Posts
    550
    Code:
    Private Sub Form_Resize()
        If Me.WindowState = vbMinimized Then Me.Hide
    End Sub
    Then add a menu item to the systray icon to maximise

    Code:
    Private Sub mPopRestore_Click()
    
    Dim Result As Long
           
        Me.WindowState = vbNormal
        Result = SetForegroundWindow(Me.hwnd)
        Me.Show
     
    End Sub

  3. #3
    Join Date
    Apr 2005
    Location
    South Africa
    Posts
    88
    I just needed to declare the SetForegorundWindow so this is what I added and everything works perfect!
    Code:
    Public Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
    Thanks alot!

  4. #4
    Join Date
    Feb 2004
    Location
    Colton, CA
    Posts
    550
    No worries

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center