A DDE client application posts the WM_DDE_ADVISE message to a DDE server application to request the server to supply an update for a data item whenever the item changes.
WM_DDE_ADVISE wParam = (WPARAM) hwnd; // handle of posting application lParam = (LPARAM) lPackedVal; // packed DDEADVISE and item atom
Parameter |
Description |
hOptions |
Identifies a global memory object containing a DDEADVISE structure that specifies how the data is to be sent. |
aItem |
Contains an atom that identifies the requested data item. |
The client application posts the WM_DDE_ADVISE message by calling the PostMessage function, not the SendMessage function.
The client application allocates hOptions by calling the GlobalAlloc function with the GMEM_DDESHARE option. It allocates aItem by calling the GlobalAddAtom function.
The client application must create or reuse the WM_DDE_ADVISE lPackedVal parameter by calling the PackDDElParam function or the ReuseDDElParam function with hOptions supplied as the low-order word and aItem supplied as the high-order word.
If the receiving (server) application responds with a negative WM_DDE_ACK message, the posting (client) application must delete the hOptions object.
The server application posts the WM_DDE_ACK message to respond positively or negatively. When posting WM_DDE_ACK, the application can reuse the aItem atom or delete it and create a new one. If the WM_DDE_ACK message is positive, the application should delete the hOptions object; otherwise, the application should not delete the object.
The server must create or reuse the WM_DDE_ACK lPackedVal parameter by calling the PackDDElParam function or the ReuseDDElParam function with wStatus supplied as the low-order word and aItem supplied as the high-order word.
DDEADVISE, FreeDDElParam, GlobalAddAtom, GlobalAlloc, PackDDElParam, PostMessage, ReuseDDElParam, SendMessage, UnpackDDElParam, WM_DDE_ACK, WM_DDE_DATA, WM_DDE_POKE, WM_DDE_REQUEST