Drigo
June 26th, 2009, 04:45
Hey Guys
I want to close a external Msgbox very quick. Now I use following code:
Private Sub MessabgeboxFinder_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DemomessageFinder.Tick
MessabgeboxFinder.Enabled = False
Dim APPMSGBOXHandle As Integer
APPMSGBOXHandle = FindWindow("#32770", "Can Terminal 1.0"
If APPMSGBOXHandle > 0 Then
SendMessage(APPMSGBOXHandle, WM_CLOSE, 0, 0)
End If
APPMSGBOXHandle = FindWindow("#32770", "Best Canterminal 1.0"
If APPMSGBOXHandle > 0 Then
SendMessage(APPMSGBOXHandle, WM_CLOSE, 0, 0)
End If
APPMSGBOXHandle = FindWindow("#32770", "Ultimative Can Terminal 1.0"
If APPMSGBOXHandle > 0 Then
SendMessage(APPMSGBOXHandle, WM_CLOSE, 0, 0)
End If
APPMSGBOXHandle = FindWindow("#32770", " Can Terminal 1.0"
MessabgeboxFinder.Enabled = True
End Sub
Timertick = 10ms
10ms are faster then 1ms -> I don't know why.
But this is not fast enough. With Do Loop I have to much CPU Performance (Yes I use DoEvent).
Does anybody know, how i can make this faster??
Thanks for all answers.
I want to close a external Msgbox very quick. Now I use following code:
Private Sub MessabgeboxFinder_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DemomessageFinder.Tick
MessabgeboxFinder.Enabled = False
Dim APPMSGBOXHandle As Integer
APPMSGBOXHandle = FindWindow("#32770", "Can Terminal 1.0"

If APPMSGBOXHandle > 0 Then
SendMessage(APPMSGBOXHandle, WM_CLOSE, 0, 0)
End If
APPMSGBOXHandle = FindWindow("#32770", "Best Canterminal 1.0"

If APPMSGBOXHandle > 0 Then
SendMessage(APPMSGBOXHandle, WM_CLOSE, 0, 0)
End If
APPMSGBOXHandle = FindWindow("#32770", "Ultimative Can Terminal 1.0"

If APPMSGBOXHandle > 0 Then
SendMessage(APPMSGBOXHandle, WM_CLOSE, 0, 0)
End If
APPMSGBOXHandle = FindWindow("#32770", " Can Terminal 1.0"

MessabgeboxFinder.Enabled = True
End Sub
Timertick = 10ms
10ms are faster then 1ms -> I don't know why.
But this is not fast enough. With Do Loop I have to much CPU Performance (Yes I use DoEvent).
Does anybody know, how i can make this faster??
Thanks for all answers.