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.
Chris
Jun 23rd, 2000, 01:40 AM
Use the SetWindowPosAPI will do.
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
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.