Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 10
#Compile Exe
#Dim All
%Unicode=1
#Include "Win32API.inc"
%IDC_Button = 500
Global hDlg As Dword
Function PBMain() As Long
Dialog Default Font "Tahoma", 12, 1
Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, %IDC_Button,"Push", 50,10,100,25
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
If Cb.Msg = %WM_Command And Cb.Ctl = %IDC_Button Then
ReadText "Hello from Gary Beene"
End If
End Function
Sub ReadText (sText As String)
Local vRes, vTxt, vTime, vRate As Variant, oSp As Dispatch
Let oSp = NewCom "SAPI.SpVoice"
If IsFalse IsObject(oSp) Then Exit Sub
vRate = -3
Object Let oSp.Rate() = vRate
vTxt = sText
Object Call oSp.Speak(vTxt) To vRes
vTime = -1 As Long
Object Call oSp.WaitUntilDone(vTime) To vRes
End Sub
http://www.garybeene.com/sw/gbsnippets.htm