|
-
Sep 11th, 2000, 12:57 PM
#1
Thread Starter
PowerPoster
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?
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Sep 11th, 2000, 01:04 PM
#2
Addicted Member
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]
-
Sep 11th, 2000, 01:04 PM
#3
Lively Member
Code:
Private Sub Form_Resize()
If Me.WindowState = 1 Then
MsgBox "current form if minimized"
End If
End Sub
-
Sep 11th, 2000, 02:04 PM
#4
Thread Starter
PowerPoster
Another question
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?
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Sep 11th, 2000, 02:08 PM
#5
Monday Morning Lunatic
In the Resize event for your MDIForm, centre the other form there.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Sep 11th, 2000, 02:32 PM
#6
Thread Starter
PowerPoster
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Sep 11th, 2000, 02:43 PM
#7
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|