Jump to content

Some sort of interprocess communication

Recommended Posts

but it doesent work right...

only the 'int' part of the struct is forwarded


Global Const $WM_USER = 0x400
Global Const $UM_AU3MESSAGE = $WM_USER + 0x125
Global Const $STRUCTDEF_AU3MESSAGE = "char[256];int"

$hWnd_Main = GUICreate("Au3MessageServer")
Func _Au3Message($hWnd, $MsgID, $WParam, $LParam)
; $WParam = Pointer
    $Au3Message2 = DllStructCreate($STRUCTDEF_AU3MESSAGE,$LParam)
    MsgBox(0,"Server","Struct Size = " & DllStructGetSize($Au3Message2))
    MsgBox(0,"Server","Struct 1 = " & DllStructGetData($Au3Message2,1))
    MsgBox(0,"Server","Struct 2 = " & DllStructGetData($Au3Message2,2))
    Return @AutoItPID
While 1
Global Const $WM_USER = 0x400
Global Const $UM_AU3MESSAGE = $WM_USER + 0x125
Global Const $STRUCTDEF_AU3MESSAGE = "char[256];int"

$hWnd_Server = WinGetHandle("Au3MessageServer")
$Au3Message1 = DllStructCreate($STRUCTDEF_AU3MESSAGE)
DllStructSetData($Au3Message1,1,"Test Blah Blah ...")
MsgBox(0,"Client","Struct Size = " & DllStructGetSize($Au3Message1))
$r = DllCall("user32.dll","int","SendMessage", _
            "hWnd",$hWnd_Server, _
            "int",$UM_AU3MESSAGE, _
            "int",0, _
$Au3Message1 = 0
MsgBox(0,"Client","Server Return (Pid) = " &$r[0])
; Kill Server

any idea why DllStructGetData($Au3Message1,1) doesent return "Test Blah Blah ..." ?

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...