Pergunta

I'm developing an application with tab controls. After clicking on an icon in a tab, a popup window opens and the contents of the tab are moved to the popup window.

What I do is simple - change parent of each control within the tab to the popup window (using SetParent()). Everything works great except for listview controls (virtual listview).

After changing the parent, the listview no longer sends WM_NOTIFY notifications.

I've also tested it with non-virtual listview and the same happens.

I've searched all over google and came up with nothing, so any ideas would be appreciated.

UPDATE

After changing the parent, the listview keeps sending WM_NOTIFY notifications to its previous parent. Is this a bug in common controls?

Foi útil?

Solução

A lot of the common controls cache their parents when they are created. There's nothing you can really do about this except to create them with the right parent in the first place.

One workaround is to register a dummy window class that does nothing more than host the common control in question, and forward messages back and forwards to it. Then you can reparent that window rather than the control itself.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top