Results 1 to 3 of 3

Thread: Show/Hide MDIForm in the taskbar

  1. #1
    Guest
    Is there a way to show or hide an MDI form in the task bar(at runtime).

    I know how to toggle it for a normal form, but i can't find out how to toggle an MDIForm.

  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Smile SetWindowPos

    Use the SetWindowPosAPI will do.

    Code:
    Option Explicit
    Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
    Private Const SWP_SHOWWINDOW = &H40
    Private Const SWP_HIDEWINDOW = &H80
    Private Const SWP_NOMOVE = &H2
    Private Const SWP_NOSIZE = &H1
    
    Private Sub Command1_Click()
    'Hide
    SetWindowPos MDIForm1.hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_HIDEWINDOW
    End Sub
    
    Private Sub Command2_Click()
    'Show
    SetWindowPos MDIForm1.hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_SHOWWINDOW
    End Sub

  3. #3
    Guest
    Setting the form to invisible does the same thing, the problem is that my app is in the systray, and when it is in the systray i dont want it to be visible in the taskbar.


    Thanks for the reply anyway.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width