Problem with Messageboxtimeout on VB6

Asked

Viewed 8 times

1

I’m calling the function Messageboxtimeout from user32.dll but when I use the type (iType = vbInformation) always returns vbok, IE, I can not know when timeout occurred.

Follows the code:


Public Function MsgBoxDelay(strMsg As String, strTitle As String, iTimeout As Long, iType As Integer) As Integer
    On Error GoTo trataerro
    
    MsgBoxDelay = MessageBoxTimeout(FrmCartao.hwnd, strMsg, strTitle, iType, 0, iTimeout * 1000)

    If MsgBoxDelay <> vbYes And MsgBoxDelay <> vbNo And MsgBoxDelay <> vbOK Then
        Call GravaLog("MsgBoxDelay: Erro de Timeout")
        gbAATimedOut = True
    End If

    Exit Function

trataerro:
    MsgBox "Erro VB - Função MsgBoxDelay: " & vbCrLf & vbCrLf _
         & "Numero: " & Err.Number & vbCrLf _
         & "Descrição: " & Err.Description, vbCritical, "Erro!"
End Function

Someone’s had that problem before?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.