是的,您可以使用 Dragon NaturallySpeaking 的高级脚本将活动窗口的标题复制到剪贴板,如下所示:
'
' get window title
'
Sub Main
Clipboard ( GetWindowTitle )
End Sub
'
' Use these Windows Functions for Getting an active Window title
'
Declare Function GetForegroundWindow Lib "user32" () As Long
'
Declare Function GetWindowText Lib "user32" _
Alias "GetWindowTextA" ( ByVal hwnd As Long , _
ByVal lpString As String , ByVal cch As Long ) As Long
'
' GetWindowTitle
' (Gets an active Window title)
'
Function GetWindowTitle() As String
Dim x As Integer
Dim TitleText As String * 300
Dim hw As Long
hw = GetForegroundWindow()
x = GetWindowText ( hw , TitleText , Len ( TitleText ) )
GetWindowTitle = Trim ( Left ( TitleText , x ) )
End Function
'
现在,我将所有函数保存在一个全局 '#Uses 文件中(以及其他声明、函数和全局常量等),所以我只需要 Main Sub 部分,但您可以将所有引用的函数和声明放在一个脚本,你也需要它。
Hth