Step 8: PE_ENDDATA Message

The PE_ENDDATA message informs a target window that input for the target has ceased. The message's lParam points to a TARGET structure, the dwData member of which identifies the HRC or HPENDATA created in step 6. If recognizing

input through an HRC object, the application should let DefWindowProc handle this message. However, DefWindowProc will destroy an HPENDATA object when processing PE_ENDDATA. To preserve the HPENDATA, the application has two choices:

  • Trap the message, preventing it from reaching DefWindowProc. In this case, the HPENDATA object outlives the input session. Note that an HPENDATA object occupies memory in the system heap. When finished, the application must remove the object by calling DestroyPenData to avoid wasting resources.

  • Alternatively, copy the HPENDATA object with DuplicatePenData before letting the PE_ENDDATA message fall through to DefWindowProc. However, this approach has no advantage over the preceding method, merely trading the original object for its clone. Again, the application is responsible for destroying the new HPENDATA object.

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database