something like this...
DDE seems to be accessible via either messages or via DLL calls....
Am stuck with the 1st step of the DLL call...
DdeInitialize(&idInst, // receives instance identifier
(PFNCALLBACK) DdeCallback, // pointer to callback function
as, cannot seem to see a way to SEND A POINTER TO A CALLBACK FUNCTION IN AHK....
would seem (unless I have missed something... ) that this would have to be an aHK feature add... providing a pointer... and code to accept calls to the pointed location... type thing...
Maybe (if I even understand what is needed by the built in windows DDE DLL) ... some simple code can be placed into a variable... and the callback pointed to that var... which when executed... would trigger some kind of recognizeable Ahk event... and store the reference to the received data... in a fixed location in itself (the memory space of the var)... which could then be ref'd by AHk .....
hmm.... in effect using the external DLL to do a machine code call to the var's contents... [cool...]
that is...
http://msdn2.microsoft.com/en-us/library/ms648757.aspx
Quote:
The DdeInitialize function registers an application with the Dynamic Data Exchange Management Library (DDEML). An application must call this function before calling any other Dynamic Data Exchange Management Library (DDEML) function.
Syntax
UINT DdeInitialize( LPDWORD pidInst,
PFNCALLBACK pfnCallback,
DWORD afCmd,
DWORD ulRes
);
Parameters
pidInst
[in, out] Pointer to the application instance identifier. At initialization, this parameter should point to 0. If the function succeeds, this parameter points to the instance identifier for the application. This value should be passed as the idInst parameter in all other DDEML functions that require it. If an application uses multiple instances of the DDEML dynamic-link library (DLL), the application should provide a different callback function for each instance.
If pidInst points to a nonzero value, reinitialization of the DDEML is implied. In this case, pidInst must point to a valid application-instance identifier.
pfnCallback
[in] Pointer to the application-defined Dynamic Data Exchange (DDE) callback function. This function processes DDE transactions sent by the system. For more information, see the DdeCallback callback function.
afCmd
[in] Specifies a set of APPCMD_, CBF_, and MF_ flags. The APPCMD_ flags provide special instructions to DdeInitialize. The CBF_ flags specify filters that prevent specific types of transactions from reaching the callback function. The MF_ flags specify the types of DDE activity that a DDE monitoring application monitors. Using these flags enhances the performance of a DDE application by eliminating unnecessary calls to the callback function.
This parameter can be one or more of the following values.
APPCLASS_MONITOR
Makes it possible for the application to monitor DDE activity in the system. This flag is for use by DDE monitoring applications. The application specifies the types of DDE activity to monitor by combining one or more monitor flags with the APPCLASS_MONITOR flag. For details, see the following Remarks section.
APPCLASS_STANDARD
Registers the application as a standard (nonmonitoring) DDEML application.
APPCMD_CLIENTONLY
Prevents the application from becoming a server in a DDE conversation. The application can only be a client. This flag reduces consumption of resources by the DDEML. It includes the functionality of the CBF_FAIL_ALLSVRXACTIONS flag.
APPCMD_FILTERINITS
...
Quote:
The DdeCallback function is an application-defined callback function used with the Dynamic Data Exchange Management Library (DDEML) functions. It processes Dynamic Data Exchange (DDE) transactions. The PFNCALLBACK type defines a pointer to this callback function. DdeCallback is a placeholder for the application-defined function name.
Syntax
HDDEDATA CALLBACK DdeCallback( UINT uType,
UINT uFmt,
HCONV hconv,
HDDEDATA hsz1,
HDDEDATA hsz2,
HDDEDATA hdata,
HDDEDATA dwData1,
HDDEDATA dwData2
);
Parameters
uType
[in] Specifies the type of the current transaction. This parameter consists of a combination of transaction class flags and transaction type flags. The following table describes each of the transaction classes and provides a list of the transaction types in each class. For information about a specific transaction type, see the individual description of that type.
XCLASS_BOOL
A DDE callback function should return TRUE or FALSE when it finishes processing a transaction that belongs to this class. The XCLASS_BOOL transaction class consists of the following types:
XTYP_ADVSTART
XTYP_CONNECT
XCLASS_DATA
A DDE callback function should return a DDE handle, the CBR_BLOCK return code, or NULL when it finishes processing a transaction that belongs to this class. The XCLASS_DATA transaction class consists of the following types:
XTYP_ADVREQ
XTYP_REQUEST
XTYP_WILDCONNECT
XCLASS_FLAGS
A DDE callback function should return DDE_FACK, DDE_FBUSY, or DDE_FNOTPROCESSED when it finishes processing a transaction that belongs to this class. The XCLASS_FLAGS transaction class consists of the following types:
XTYP_ADVDATA
XTYP_EXECUTE
XTYP_POKE
XCLASS_NOTIFICATION
The transaction types that belong to this class are for notification purposes only. The return value from the callback function is ignored. The XCLASS_NOTIFICATION transaction class consists of the following types:
XTYP_ADVSTOP
XTYP_CONNECT_CONFIRM
XTYP_DISCONNECT
XTYP_ERROR
XTYP_MONITOR
XTYP_REGISTER
XTYP_XACT_COMPLETE
XTYP_UNREGISTER
uFmt
[in] Specifies the format in which data is sent or received.
hconv
[in] Handle to the conversation associated with the current transaction.
hsz1
[in] Handle to a string. The meaning of this parameter depends on the type of the current transaction. For the meaning of this parameter, see the description of the transaction type.
hsz2
[in] Handle to a string. The meaning of this parameter depends on the type of the current transaction. For the meaning of this parameter, see the description of the transaction type.
hdata
[in] Handle to DDE data. The meaning of this parameter depends on the type of the current transaction. For the meaning of this parameter, see the description of the transaction type.
dwData1
[in] Specifies transaction-specific data. For the meaning of this parameter, see the description of the transaction type.
dwData2
[in] Specifies transaction-specific data. For the meaning of this parameter, see the description of the transaction type.
Return Value
The return value depends on the transaction class. For more information about the return values, see descriptions of the individual transaction types.
Remarks
The callback function is called asynchronously for transactions that do not involve the creation or termination of conversations. An application that does not frequently accept incoming messages will have reduced DDE performance because the Dynamic Data Exchange Management Library (DDEML) uses messages to initiate transactions.
An application must register the callback function by specifying a pointer to the function in a call to the DdeInitialize function.
Library Overview, DdeEnableCallback, DdeInitialize