In my application there are a lots of dialogs being opened and closed all the time. The dialogs are non-modal.
In order to save some performace, we are "recycling" some of the more complicated controls. When one dialog is closed, the controls are not destroyed, but their pointers are stored in an array so that they can be reused when another dialog is opened.
The problem is that after the control is positioned in the new dialog, it does not receive all the messages. For instance the message WM_DRAWITEM
(the control is derived from CListCtrl
) is not being sent anymore. The WM_LBUTTONDOWN
on the other hand is still arriving. It is as if the control does not know its class anymore. The NC area (border and list header) is being painted correctly.
Did anyone have similar problems? What could be wrong? Can the controls be "detached" and "reattached" in this way at all?
Asked
Active
Viewed 95 times
0

P̲̳x͓L̳
- 3,615
- 3
- 29
- 37

Bojan Hrnkas
- 1,587
- 16
- 22
1 Answers
0
For CListCtrl to respond to WM_DRAWITEM image it is needed it has the LVS_OWNERDRAWFIXED style. Are you sure you have it set?
And from http://msdn.microsoft.com/en-us/library/windows/desktop/bb774739(v=vs.85).aspx , it seems it only occurs if it is in Report view (Seems strange to me!).

sergiol
- 4,122
- 4
- 47
- 81