Please copy and paste the procedure into a message so that we can see what
you're doing. If the variables aren't declared in the procedure, list where
they are declared and the line used to declare them.
Thank-you, sir. Per your request, I use this...
PlayHelp = fPlayStuff("C:\ Program Files\TowPack\h elp\Help-70.wav", 1)
to call the following procedure in an A97 standard module...
Function fPlayStuff(ByVa l strFilename As String, _
Optional intPlayMode As Integer) As Long
'MUST pass a filename _with_ extension
'Supports Wav, AVI, MID type files
Dim lngRet As Long
Dim strTemp As String
Select Case LCase(fGetFileE xt(strFilename) )
Case "wav":
If Not IsMissing(intPl ayMode) Then
lngRet = apiPlaySound(st rFilename, intPlayMode)
Else
MsgBox "Must specify play mode."
Exit Function
End If
Case "avi", "mid":
strTemp = String$(256, 0)
lngRet = apimciSendStrin g("play " & strFilename, strTemp,
255, 0)
End Select
fPlayStuff = lngRet
End Function
The PlayHelp assignment in the first code line above is part of
a mousedown procedure shown here...
Private Sub VehicleChooserb ox_MouseDown(Bu tton As Integer, Shift As
Integer, X As Single, Y As Single)
On Error GoTo ErrorVehicleCho oserbox_MouseDo wn
Dim ThisForm As String
ThisForm = Me.Name
Dim Help As String, MyControl As Control
Set MyControl = Screen.ActiveCo ntrol
Help = MyControl.Tag
If Shift = 0 Then
If Button = RIGHT_BUTTON Then MsgBox Help, 64, MyApp$ & ",
rev. " & MY_VERSION$
Else
If Button = RIGHT_BUTTON Then
Select Case Shift
Case SHIFT_MASK
MsgBox "You pressed SHIFT & Rite Mouse Button!"
Case CTRL_MASK
'MsgBox "You pressed CTRL & Rite Mouse Button!"
Dim PlayHelp As Variant
PlayHelp = fPlayStuff("C:\ Program
Files\TowPack\h elp\Help-70.wav", 1)
Case ALT_MASK
MsgBox "You pressed ALT & Rite Mouse Button!"
End Select
End If
End If
ExitVehicleChoo serbox_MouseDow n:
Exit Sub
ErrorVehicleCho oserbox_MouseDo wn:
Dim r As String, k As String, Message3 As String
r = "The following unexpected error occurred in Sub
VehicleChooserb ox_MouseDown, CBF on " & ThisForm & "."
k = CRLF & CRLF & Str$(Err) & ": " & Quote & Error$ & Quote
Message3 = r & k
MsgBox Message3, 48, "Unexpected Error - " & MyApp$ & ", rev. " &
MY_VERSION$
Resume ExitVehicleChoo serbox_MouseDow n
End Sub
Sometimes, further rite-mouse clicks on the same (or other) controls
launch the CTRL-RiteClik code instead of just the RiteClick stuff. I
have tested, waiting until the audio file finishes playback and NOT
waiting for it to finish. Either way, the CTRL key still acts stuck.
The only way, it seems, to un-stick it is by the active form losing
the focus to another form or the database window. When I come
back to it, the CTRL key is no longer 'stuck'.