I have a MDI form application. When the form is minimized, I would like to flash the caption in the Taskbar. How can this be performed?
Printable View
I have a MDI form application. When the form is minimized, I would like to flash the caption in the Taskbar. How can this be performed?
When a form is maximized, the windowstate property of the form is equal to vbMaximized.
If frm.WindowState = vbMaximized Then
'...... FlashWindow procedure ......
End If
[Edited by Shafee on 09-11-2000 at 02:06 PM]
Code:
Private Sub Form_Resize()
If Me.WindowState = 1 Then
MsgBox "current form if minimized"
End If
End Sub
Thank you both.
Ok I got it to flash when minimized...
Now on Form1 load I call a function which properly centers form within the MDIform, but if Form1 hasn't loaded yet, and the MDIform is minimized, Form1 is not centered when it is loaded. Where must I put the code on FORM1 to recenter once MDIform in maximized?
In the Resize event for your MDIForm, centre the other form there.
Thank you all...
Here is how to flash the window.
Code:Declare Function FlashWindow& Lib "user32" (ByVal hwnd As Long, _
ByVal bInvert As Long)
Declare Function FindWindow& Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String)
Private Declare Sub Sleep Lib "kernel32" _
(ByVal dwMilliseconds As Long)
Dim h As Integer
Private Sub Form_Load()
h = FindWindow(vbNullString, "MyForm's Caption")
Timer1.Interval = 100
End Sub
Private Sub Form_Resize()
If Me.WindowState = 1 Then
Timer1.Enabled = True
Else
Timer1.Enabled = False
End If
End Sub
Private Sub Timer1_Timer()
Do Until Me.WindowState <> 1
hFlash = FlashWindow(h, 1)
DoEvents
Sleep (300)
Loop
Timer1.Enabled = False
End Sub