LDericher Posted April 29, 2009 Share Posted April 29, 2009 So, I've seen the material following this LINK:http://www.autoitscript.com/forum/index.php?showtopic=77979and the Module can be seen here: http://www.autoitscript.com/forum/index.ph...st&id=22855Now, I have to translate the "_SendData"-Function to Delphi-Code.Here the original Func:expandcollapse popupFunc _SendData($vData,$ReceiverTitle) Local $strLen,$CDString,$vs_cds,$pCDString,$pStruct,$hwndRec If StringLen($ReceiverTitle) = 0 then Return SetError(1,1,0);Make sure the user has specified a title $ReceiverTitle&= $MHAdditionalIdentifier $strLen = StringLen($vData) $CDString = DllStructCreate("char var1[" & $strLen +1 & "]");the array to hold the string we are sending DllStructSetData($CDString,1,$vData) $pCDString = DllStructGetPtr($CDString);the pointer to the string $vs_cds = DllStructCreate($StructDef_COPYDATA);create the message struct DllStructSetData($vs_cds,"count",$strLen + 1);tell the receiver the length of the string +1 DllStructSetData($vs_cds,"pointer",$pCDString);the pointer to the string $pStruct = DllStructGetPtr($vs_cds) $hwndRec = WinGetHandle($ReceiverTitle) If $hwndRec = "" then $vs_cds = 0;free the struct $CDString = 0;free the struct Return SetError(1,2,0) EndIf DllCall("user32.dll", "lparam", "SendMessage", "hwnd", $hwndRec, "int", $WM_COPYDATA_MH, "wparam", 0, "lparam", $pStruct) If @error then $vs_cds = 0;free the struct $CDString = 0;free the struct return SetError(1, 3, 0) ;return 0 no data sent EndIf $vs_cds = 0;free the struct $CDString = 0;free the struct Return $strLen EndFuncCan someone please help me?Thx in advance, The LDer Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now