开发工具:
文件大小: 10kb
下载次数: 0
上传时间: 2006-02-23
详细说明: ‘文本朗读.vbpType=ExeReference=*G{00020430-0000-0000-C000-000000000046}#2.0#0#C:WINDOWSSystem32stdole2.tlb#OLE AutomationReference=*G{C866CA3A-32F7-11D2-9602-00C04F8EE628}#5.0#0#C:Program FilesCommon FilesMicrosoft SharedSpeechsapi.dll#Microsoft Speech Object LibraryReference=*G{00020905-0000-0000-C000-000000000046}#8.3#0#C:Program FilesMicrosoft OfficeOFFICE11MSWORD.OLB#Microsoft Word 11.0 Object LibraryObject={3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0; richtx32.ocxObject={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; COMDLG32.OCX Form=文本朗读.frmForm=frmAbout.frmModule=mDeclares; MoudlesmDeclares.basModule=MSubclass; Moudlessubclass.basModule=MTimer; Moudles imer.basClass=cMemDC; ClassMoudlescMemDC.clsClass=cMenuBar; ClassMoudlescMenuBar.clsClass=cNCCalcSize; ClassMoudlescNCCalcSize.clsClass=cNeoCaption; ClassMoudlescNeoCaption.clsClass=cToolbarMenu; ClassMoudlescToolbarMenu.clsClass=INCAreaModifier; ClassMoudlesINCAreaModifier.clsClass=ISubclass; ClassMoudlesisubclass.clsClass=GSubclass; ClassMoudlessubclass.clsClass=CTimer; ClassMoudles imer.clsModule=Module1; Module1.basObject={6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0; COMCTL32.OCXIconForm="Form1"Startup="Form1"HelpFile=""Title="文本朗读"ExeName32="文本朗读.exe"Command32=""Name="工程1"HelpContextID="0"CompatibleMode="0"MajorVer=1MinorVer=1RevisionVer=22AutoIncrementVer=1ServerSupportFiles=0VersionCompanyName="安阳市监狱"CompilationType=0OptimizationType=0FavorPentiumPro(tm)=0CodeViewDebugInfo=0NoAliasing=0BoundsCheck=0OverflowCheck=0FlPointCheck=0FDIVCheck=0UnroundedFP=0StartMode=0Unattended=0Retained=0ThreadPerObject=0MaxNumberOfThreads=1DebugStartupOption=0[MS Transaction Server]AutoRefresh=1‘文本朗读.frmVERSION 5.00Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "richtx32.ocx"Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"Begin VB.Form Form1 AutoRedraw = -1 ‘True Caption = "文本播放器 1.1版" ClientHeight = 6255 ClientLeft = 165 ClientTop = 555 ClientWidth = 9855 Icon = "文本朗读.frx":0000 LinkTopic = "Form1" ScaleHeight = 6255 ScaleWidth = 9855 StartUpPosition = 2 ‘屏幕中心 Begin VB.HScrollBar HScroll2 Height = 255 Left = 1080 Max = 100 TabIndex = 14 Top = 5880 Value = 50 Width = 1815 End Begin VB.PictureBox PicCaption Height = 495 Left = 240 Picture = "文本朗读.frx":08CA ScaleHeight = 435 ScaleWidth = 8715 TabIndex = 11 Top = 3960 Visible = 0 ‘False Width = 8775 Begin VB.PictureBox PicBorder Height = 135 Left = 960 Picture = "文本朗读.frx":1710C ScaleHeight = 75 ScaleWidth = 915 TabIndex = 12 Top = 240 Visible = 0 ‘False Width = 975 End End Begin VB.CommandButton Command6 Caption = "继续朗读" Height = 390 Left = 150 TabIndex = 10 Top = 3480 Width = 2760 End Begin VB.CommandButton Command5 Caption = "暂停朗读" Height = 390 Left = 150 TabIndex = 9 Top = 3000 Width = 2760 End Begin VB.HScrollBar HScroll1 Height = 255 Left = 1080 Max = 100 TabIndex = 8 Top = 5400 Value = 100 Width = 1815 End Begin MSComDlg.CommonDialog CDg1 Left = 6840 Top = 4560 _ExtentX = 847 _ExtentY = 847 _Version = 393216 Filter = "文本文件(*.txt)|*.txt|所有文件|*.*" FilterIndex = 2 End Begin VB.OptionButton Option2 Caption = "朗读选定" Height = 315 Left = 1800 TabIndex = 6 Top = 4920 Width = 1230 End Begin VB.OptionButton Option1 Caption = "朗读全文" Height = 315 Left = 120 TabIndex = 5 Top = 4920 Width = 1230 End Begin VB.CommandButton Command4 Caption = "退出程序" Height = 390 Left = 150 TabIndex = 4 Top = 4440 Width = 2760 End Begin VB.CommandButton Command3 Caption = "结束朗读" Height = 390 Left = 150 TabIndex = 3 Top = 3960 Width = 2760 End Begin VB.CommandButton Command2 Caption = "开始朗读" Height = 390 Left = 150 TabIndex = 2 Top = 2520 Width = 2760 End Begin VB.CommandButton Command1 Caption = "打开文件" Height = 390 Left = 150 TabIndex = 1 Top = 2040 Width = 2760 End Begin RichTextLib.RichTextBox RTf1 Height = 6105 Left = 3120 TabIndex = 0 Top = 30 Width = 6615 _ExtentX = 11668 _ExtentY = 10769 _Version = 393217 BackColor = 15138775 HideSelection = 0 ‘False ScrollBars = 2 AutoVerbMenu = -1 ‘True TextRTF = $"文本朗读.frx":17996 End Begin VB.Label Label1 AutoSize = -1 ‘True Caption = "语速调节:" Height = 180 Index = 1 Left = 120 TabIndex = 13 Top = 5880 Width = 900 End Begin VB.Label Label1 AutoSize = -1 ‘True Caption = "音量调节:" Height = 180 Index = 0 Left = 120 TabIndex = 7 Top = 5400 Width = 900 End Begin VB.Image Image1 Height = 1935 Left = -15 Picture = "文本朗读.frx":17A33 Stretch = -1 ‘True Top = 30 Width = 3075 End Begin VB.Menu FILEMNU Caption = "文件(&F)" Begin VB.Menu OPENMNU Caption = "打开(&O)" End Begin VB.Menu LDMNU Caption = "朗读(&L)" End Begin VB.Menu FG Caption = "-" End Begin VB.Menu EXTMNU Caption = "退出(&X)" End End Begin VB.Menu HILMNU Caption = "帮助(&H)" Begin VB.Menu aboutmnu Caption = "关于…" End EndEndAttribute VB_Name = "Form1"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalseDim ld As New SpeechLib.SpVoiceDim qorx As BooleanDim wb As StringPrivate m_cN As cNeoCaption‘这是我又一次对文本播放器进行修订,‘增加了打开word、rtf文本、音量调节功能‘但是如何保存文声音文件还没做到,对TTS的安装等还没搞清楚,‘今后还需进一步努力加以改进。yxf 2004年5月30日‘------------------------------------------------------------------‘增加语速控制功能 2004年6月28日Private Sub aboutmnu_Click()frmAbout.Show 1End SubPrivate Sub Command1_Click()On Error Resume NextRTf1.Text = ""Dim str As StringDim lstr$CDg1.ShowOpenIf CDg1.FileName <> "" ThenIf LCase(right(CDg1.FileName, 3)) = "rtf" ThenRTf1.LoadFile CDg1.FileName, 0ElseIf LCase(right(CDg1.FileName, 3)) = "doc" ThenForm1.Caption = "文本播放器1.1版--正在打开文件……"Dim myword As New Word.Applicationmyword.Documents.Open FileName:=CDg1.FileName myword.Selection.WholeStoryRTf1.Text = myword.Selectionmyword.Quit Set myword = NothingElseIf LCase(right(CDg1.FileName, 3)) = "txt" ThenForm1.Caption = "文本播放器1.1版--正在打开文件……"RTf1.LoadFile CDg1.FileName, rtfText‘opentxt CDg1.FileName, str, lstr‘RTf1 = lstrElse If MsgBox("文件无法识别,按文本格式打开?", vbYesNo, "提示") = 6 ThenForm1.Caption = "文本播放器1.1版--正在打开文件……"opentxt CDg1.FileName, str, lstrRTf1 = lstr Else Exit Sub End IfEnd IfEnd IfMe.Caption = "文本播放器1.1版--" + CDg1.FileNameEnd SubPrivate Sub Command2_Click()On Error Resume NextIf qorx Thenwb = RTf1.TextElsewb = RTf1.SelTextEnd IfSet ld = New SpeechLib.SpVoiceld.Volume = HScroll1ld.Rate = HScroll2 / 10ld.Speak wb, 1End SubPrivate Sub Command3_Click()ld.Speak "", 2Set ld = NothingEnd SubPrivate Sub Command4_Click()ld.Speak "", 2Set ld = NothingEndEnd SubPrivate Sub Command5_Click()On Error Resume Nextld.PauseEnd SubPrivate Sub Command6_Click()On Error Resume Nextld.ResumeEnd SubPrivate Sub EXTMNU_Click()Command4_ClickEnd SubPrivate Sub Form_Resize()If Form1.Width > 3300 And Me.Height > 5000 ThenForm1.RTf1.Width = Me.Width - 3300RTf1.Height = Me.Height - 1000ElseRTf1.Width = 5895End IfEnd SubPrivate Sub Skin(f As Form, cN As cNeoCaption) cN.ActiveCaptionColor = &HFFFFFF cN.InActiveCaptionColor = &HC0C0C0 cN.ActiveMenuColor = &H0& cN.ActiveMenuColorOver = &H0 cN.InActiveMenuColor = &H0& cN.MenuBackgroundColor = RGB(207, 203, 207) cN.CaptionFont.Name = "宋体" cN.CaptionFont.Size = 9 cN.MenuFont.Name = "宋体" cN.MenuFont.Size = 9 cN.Attach f, f.PicCaption.Picture, f.PicBorder.Picture, 19, 20, 90, 140, 240, 400 f.BackColor = RGB(207, 203, 207)End SubPrivate Sub Form_Load()‘Dim X0 As Long‘Dim Y0 As Long‘让窗体居中‘X0 = Screen.Width‘Y0 = Screen.Height‘X0 = (X0 - Me.Width) / 2‘Y0 = (Y0 - Me.Height) / 2‘Me.Move X0, Y0‘ Set m_cN = New cNeoCaption ‘ Skin Me, m_cNqorx = TrueRTf1.Text = " 文本播放器1.1版" + vbCrLf + " 河南省安阳市育才路" + vbCrLf + " 2004年5月8日"Option1.Value = TrueEnd SubPrivate Sub Form_Unload(Cancel As Integer)Command4.Value = TrueEnd SubPrivate Sub HScroll1_Change()On Error Resume Nextld.Volume = HScroll1End SubPrivate Sub HScroll2_Change()On Error Resume Nextld.Rate = HScroll2 / 10End SubPrivate Sub LDMNU_Click()Command2_ClickEnd SubPrivate Sub OPENMNU_Click()Command1_ClickEnd SubPrivate Sub Option2_Click()qorx = FalseEnd SubPrivate Sub Option1_Click()qorx = TrueEnd SubVERSION 5.00Begin VB.Form frmAbout BorderStyle = 3 ‘Fixed Dialog Caption = "关于 文本朗读器" ClientHeight = 3555 ClientLeft = 2340 ClientTop = 1935 ClientWidth = 5730 ClipControls = 0 ‘False Icon = "frmAbout.frx":0000 LinkTopic = "Form2" MaxButton = 0 ‘False MinButton = 0 ‘False ScaleHeight = 2453.724 ScaleMode = 0 ‘User ScaleWidth = 5380.766 ShowInTaskbar = 0 ‘False Begin VB.CommandButton cmdOK Cancel = -1 ‘True Caption = "确定" Default = -1 ‘True Height = 345 Left = 4125 TabIndex = 0 Top = 2625 Width = 1500 End Begin VB.CommandButton cmdSysInfo Caption = "系统信息(&S)..." Height = 345 Left = 4140 TabIndex = 1 Top = 3075 Width = 1485 End Begin VB.Label Label1 Caption = "作者:河南省安阳市监狱 yxf" Height = 255 Left = 240 TabIndex = 6 Top = 3240 Width = 3735 End Begin VB.Image Image1 BorderStyle = 1 ‘Fixed Single Height = 675 Left = 120 Picture = "frmAbout.frx":08CA Stretch = -1 ‘True Top = 240 Width = 720 End Begin VB.Line Line1 BorderColor = &H00808080& BorderStyle = 6 ‘Inside Solid Index = 1 X1 = 84.515 X2 = 5309.398 Y1 = 1687.583 Y2 = 1687.583 End Begin VB.Label lblDescription Caption = $"frmAbout.frx":175602 ForeColor = &H00000000& Height = 1170 Left = 1080 TabIndex = 2 Top = 1125 Width = 3765 End Begin VB.Label lblTitle Caption = "文本朗读器" BeginProperty Font Name = "隶书" Size = 21.75 Charset = 134 Weight = 400 Underline = -1 ‘True Italic = -1 ‘True Strikethrough = 0 ‘False EndProperty ForeColor = &H000000FF& Height = 600 Left = 1080 TabIndex = 4 Top = 120 Width = 3885 End Begin VB.Line Line1 BorderColor = &H00FFFFFF& BorderWidth = 2 Index = 0 X1 = 98.6 X2 = 5309.398 Y1 = 1697.936 Y2 = 1697.936 End Begin VB.Label lblVersion Caption = "版本:1.1" Height = 225 Left = 1050 TabIndex = 5 Top = 780 Width = 3885 End Begin VB.Label lblDisclaimer Caption = "警告:本软件可以自由使用,但因对其使用而 带来的任何不良后果概不负责!" ForeColor = &H00000000& Height = 420 Left = 255 TabIndex = 3 Top = 2625 Width = 3630 EndEndAttribute VB_Name = "frmAbout"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalseOption Explicit‘ 注册表关键字安全选项...Const READ_CONTROL = &H20000Const KEY_QUERY_VALUE = &H1Const KEY_SET_VALUE = &H2Const KEY_CREATE_SUB_KEY = &H4Const KEY_ENUMERATE_SUB_KEYS = &H8Const KEY_NOTIFY = &H10Const KEY_CREATE_LINK = &H20Const KEY_ALL_ACCESS = KEY_QUERY_VALUE + KEY_SET_VALUE + _ KEY_CREATE_SUB_KEY + KEY_ENUMERATE_SUB_KEYS + _ KEY_NOTIFY + KEY_CREATE_LINK + READ_CONTROL ‘ 注册表关键字 ROOT 类型...Const HKEY_LOCAL_MACHINE = &H80000002Const ERROR_SUCCESS = 0Const REG_SZ = 1 ‘ 独立的空的终结字符串Const REG_DWORD = 4 ‘ 32位数字Const gREGKEYSYSINFOLOC = "SOFTWAREMicrosoftShared Tools Location"Const gREGVALSYSINFOLOC = "MSINFO"Const gREGKEYSYSINFO = "SOFTWAREMicrosoftShared ToolsMSINFO"Const gREGVALSYSINFO = "PATH"Private Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, ByRef phkResult As Long) As LongPrivate Declare Function RegQueryValueEx Lib "advapi32" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, ByRef lpType As Long, ByVal lpData As String, ByRef lpcbData As Long) As LongPrivate Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As LongPrivate Sub cmdSysInfo_Click() Call StartSysInfoEnd SubPrivate Sub cmdOK_Click() Unload MeEnd SubPrivate Sub Form_Load()Dim X0 As LongDim Y0 As Long‘让窗体居中X0 = Screen.WidthY0 = Screen.HeightX0 = (X0 - Me.Width) / 2Y0 = (Y0 - Me.Height) / 2Me.Move X0, Y0End SubPublic Sub StartSysInfo() On Error GoTo SysInfoErr Dim rc As Long Dim SysInfoPath As String ‘ 试图从注册表中获得系统信息程序的路径及名称... If GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFO, gREGVALSYSINFO, SysInfoPath) Then ‘ 试图仅从注册表中获得系统信息程序的路径... ElseIf GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFOLOC, gREGVALSYSINFOLOC, SysInfoPath) Then ‘ 已知32位文件版本的有效位置 If (Dir(SysInfoPath & "MSINFO32.EXE") <> "") Then SysInfoPath = SysInfoPath & "MSINFO32.EXE" ‘ 错误 - 文件不能被找到... Else GoTo SysInfoErr End If ‘ 错误 - 注册表相应条目不能被找到... Else GoTo SysInfoErr End If Call Shell(SysInfoPath, vbNormalFocus) Exit SubSysInfoErr: MsgBox "此时系统信息不可用", vbOKOnlyEnd SubPublic Function GetKeyValue(KeyRoot As Long, KeyName As String, SubKeyRef As String, ByRef KeyVal As String) As Boolean Dim i As Long ‘ 循环计数器 Dim rc As Long ‘ 返回代码 Dim hKey As Long ‘ 打开的注册表关键字句柄 Dim hDepth As Long ‘ Dim KeyValType As Long ‘ 注册表关键字数据类型 Dim tmpVal As String ‘ 注册表关键字值的临时存储器 Dim KeyValSize As Long ‘ 注册表关键自变量的尺寸 ‘------------------------------------------------------------ ‘ 打开 {HKEY_LOCAL_MACHINE...} 下的 RegKey ‘------------------------------------------------------------ rc = RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS, hKey) ‘ 打开注册表关键字 If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError ‘ 处理错误... tmpVal = String$(1024, 0) ‘ 分配变量空间 KeyValSize = 1024 ‘ 标记变量尺寸 ‘------------------------------------------------------------ ‘ 检索注册表关键字的值... ‘------------------------------------------------------------ rc = RegQueryValueEx(hKey, SubKeyRef, 0, _ KeyValType, tmpVal, KeyValSize) ‘ 获得/创建关键字值 If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError ‘ 处理错误 If (Asc(Mid(tmpVal, KeyValSize, 1)) = 0) Then ‘ Win95 外接程序空终结字符串... tmpVal = Left(tmpVal, KeyValSize - 1) ‘ Null 被找到,从字符串中分离出来 Else ‘ WinNT 没有空终结字符串... tmpVal = Left(tmpVal, KeyValSize) ‘ Null 没有被找到, 分离字符串 End If ‘------------------------------------------------------------ ‘ 决定转换的关键字的值类型... ‘------------------------------------------------------------ Select Case KeyValType ‘ 搜索数据类型... Case REG_SZ ‘ 字符串注册关键字数据类型 KeyVal = tmpVal ‘ 复制字符串的值 Case REG_DWORD ‘ 四字节的注册表关键字数据类型 For i = Len(tmpVal) To 1 Step -1 ‘ 将每位进行转换 KeyVal = KeyVal + Hex(Asc(Mid(tmpVal, i, 1))) ‘ 生成值字符。 By Char。 Next KeyVal = Format$("&h" + KeyVal) ‘ 转换四字节的字符为字符串 End Select GetKeyValue = True ‘ 返回成功 rc = RegCloseKey(hKey) ‘ 关闭注册表关键字 Exit Function ‘ 退出 GetKeyError: ‘ 错误发生后将其清除... KeyVal = "" ‘ 设置返回值到空字符串 GetKeyValue = False ‘ 返回失败 rc = RegCloseKey(hKey) ‘ 关闭注册表关键字End Function ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.