Jump to content
Sign in to follow this  
McGod

WM_COPYDATA

Recommended Posts

I'm trying to recieve a WM_COPYDATA.

Code:

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Autoit Form", 508, 579, 193, 125)
GUIRegisterMsg($WM_COPYDATA, "Hmmmm")
$Edit1 = GUICtrlCreateEdit("", 0, 0, 505, 577)
GUICtrlSetData(-1, "Edit1")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Func Hmmmm ($hWnd, $iMsgID, $WParam, $LParam)
    GUICtrlSetData($Edit1, "Window: " & WinGetTitle($hWnd) & @CRLF & _
                            "iMsgId: " & $iMsgID & @CRLf & _
                            "WParam: " & $WParam & @CRLF & _
                            "LParam: " & $LParam & @CRLF & _
                            "GetData: " & DllStructGetData($LParam, 0) & @CRLF & _
                            "GetSize: " & DllStructGetSize($LParam),1)
EndFunc

Example of what i Get:

Window: Autoit Form

iMsgId: 74

WParam: 0x00520672

LParam: 0x0089F774

GetData: 0

GetSize: 0

AFAIK, LParam points to a copydatastruct, any help, I'm total noob when it comes to structs and dll calls:X

Share this post


Link to post
Share on other sites

this is what I used for the SciTE interface:; Received Data from SciTE

Func MY_WM_COPYDATA($hWnd, $msg, $wParam, $lParam)
    Local $COPYDATA = DllStructCreate('Ptr;DWord;Ptr',$lparam)
    $SciTECmdLen = DllStructGetData($COPYDATA, 2)
    Local $CmdStruct = DllStructCreate('Char['&$SciTECmdLen+1&']',DllStructGetData($COPYDATA, 3))
    $SciTECmd = Stringleft(DllStructGetData($CmdStruct, 1),$SciTECmdLen)
    ConsoleWrite('<--' & $SciTECmd & @lf )
EndFunc  ;==>MY_WM_COPYDATA

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
:) Works perfectly ty:D

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...