Sub App_Start
Form1.Show
Hardware1.New1
timer1.Interval = 5000
timer1.Enabled = true
Msgbox("Some Message","title",cMsgboxOK)
timer1.Enabled = false
End Sub
Sub Timer1_Tick
Timer1.Enabled = False
Hardware1.KeyPress(13)
End Sub
While the main (and only) thread waits for the msgbox to be closed it is free to handle other events.
Most user events will not happen as the form and all its controls are blocked until the msgbox is closed, however the timer continues to raise events.