Tried it... same thing happens when displaying a dialog instead.

And as I mentioned before, some other strange things go on when using the mouse to change the focus item.

The background: I'm validating an input dialog (displayed as child) and only allow an item change if all input is correct. So I (a) want to inform the user by a message box of a false entry and (b) want to set the focus to the CEdit box containing the wrong value and select whole content.

What should I say: It does not work when using the mouse, but it does when using the keyboard. When using the mouse to change item focus, the focus is returned to the CListCtrl (even I see a blue flash of selected text in the CEdit box).

For displaying a message box and avoiding the doubled message, I post an app message with a pointer to a string member. The message is received after the LVN_ITEMCHANGING message is fully processed and the message handler displays the apropriate message box.

Now I tried to put the pEdit->SetFocus() and pEdit->SetSel(0,-1) code after display of the message box (in the handler of the application message), but this won't work either: The focus is still returned to the CListCtrl.

I also tried to: Capture the mouse and release the capture, pump the windows messages for the CListCtrl prior to pEdit->SetFocus(); pEdit->SetSel(0,-1) without any success!

Is it such a strange idea to use LVN_ITEMCHANGING in this way?

I'll keep on searching for a solution since - what can I say - I can't explain it to my customers and if I could, it's not their business anyway.

Maybe anyone can help me shed some light on this issue... Thanks you all in advance!

Oliver.