Für diesen Tipp brauchen Sie eine Form, einen Timer (Intervall 1000), zwei Commandbuttons und einen Label
Private Declare Function MessageBox Lib "user32" Alias "MessageBoxA" _
(ByVal hwnd As Long, ByVal lpText As String, ByVal lPCaption As String, _
ByVal wType As Long) As Long
Private Sub Command1_Click()
' Modale Messagebox
' Es werden keine anderen Ereignisse verarbeitet
MsgBox "Ganz normale Messagebox, Timer ist angehalten", vbOKOnly + vbInformation
End Sub
Private Sub Command2_Click()
' nichtmodal
' alles läuft weiter...
Dim rVal As Long
rVal = MessageBox(Me.hwnd, "Messagebox per API, Timer läuft weiter", _
"API-Timer", vbInformation Or vbApplicationModal)
End Sub
Private Sub Timer1_Timer()
Static zahl As Long
zahl = zahl + 1
Label1.Caption = zahl
End Sub