image\tips.gif Creating notification windows

 

The first step in requesting DDE notifications through OLE Automation is to create a notification window that will receive the formatted messages from Imagenation. The window can be a list box, a combo box, or an edit control. Its handle is passed when a notification is registered. When a registered action occurs, Imagenation sets the text of the edit control or adds an item to the list box or combo box.

You may find it easier to use an edit control. Any time the text in an edit control changes, Windows sends a message with an EN_CHANGE parameter. You can line off this message to be advised of any notification data that is set in that edit control.

For an example of this using C++, click Example: C++ code for handling an EN_CHANGE message for an edit control notification window.

List boxes and combo boxes do not generate messages when they change. If you are using them, you may have to, for example, subclass a window on the list box or combo box to look for LB_ADDSTRING messages on list boxes, or to look for CB_ADDSTRING messages for combo boxes.

The number of notification windows that are used is up to you. You can have all the registered notifications use the same window, or you can have different windows for each registered notification. Using different notification windows for each would be a way to identify the notification received without having to interpret the notification ID.

Back to: Requesting notifications