我正在尝试将文字传递给第三方程序,但遇到了麻烦。
我已经在程序中隔离了类处理程序ID,并使用消息框进行了验证。但是,当我尝试发送文本时,我收到运行时错误。
ROLLBACK TRANSACTION
和
Public Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Int32
Public Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Int32, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32
Public Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Int32, ByVal hWnd2 As Int32, ByVal lpsz1 As String, ByVal lpsz2 As String) As Int32
Dim hwnd As Integer
Dim hwindow2 As Integer
Dim main_view As Integer
Dim sub_window As Integer
Public Const WM_SETTEXT = &H0
任何帮助将不胜感激。 感谢
答案 0 :(得分:-1)
您可能会考虑使用PostMessage(),它是一种异步方法,它不会等待来自接收端的响应。虽然SendMessage方法是同步的,但它在窗口过程处理完消息之后才会返回。 查看帖子here
中的建议指出错误消息以更好地理解问题也是很好的。