Type COPYDATASTRUCT dwData As Long cbData As Long lpData As String ' void * のつもり End Type
Declare Function SendMessage Lib "user32" Alias "SendMessageA" _ (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ lParam As Any) As Long
Function GetFromHAMLOG(Command As Long) As String
Dim cmmd As Long
Dim Hwnd1, Hwnd2, myhwnd As Long
Dim cds As COPYDATASTRUCT
Dim cbuff As String * 512
Dim X As Long
Hwnd1 = FindWindow("TThwin", vbNullString) If Hwnd1 < 1 Then ' ハムログが起動していない Exit Function End If
私のプログラムで,SendMessageの定義, Declare Function SendMessage Lib "user32" Alias "SendMessageA" _ (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ lParam As Any) As Long
そんなことで,この間,ZAChkのプログラムに関して,浜田さんとやり取りしている中で,相談したところ, Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _ (hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)
を教えてもらい,一発で解決できました.
Public Function WindowProc(ByVal hwnd As Long, ByVal uMsg As Long, _ ByVal wParam As Long, ByVal lParam As Long) As Long
の中で, Select Case uMsg Case WM_COPYDATA Dim cds As COPYDATASTRUCT Dim buf(1 To 255) As Byte Call CopyMemory(cds, ByVal lParam, Len(cds))