I am having a number of controls childed to a combobox within dialog box. And I want to process some messages received by the combobox in the dialog box msg. processing procedure. So I have subclassed the combobox and resending needed messages to the the dialog box msg proc:

sub_msg_proc PROC hWin:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD

invoke CallWindowProc, , hWin, uMsg, wParam, lParam

.if (uMsg == WM_COMMAND)
invoke SendMessage, , uMsg, wParam, lParam

sub_msg_proc ENDP

Everything works fine besides the selection rectangle is not removed from an item when another item is selected. Is there any message I should resend to fix the selection problem?

Posted on 2005-07-15 09:05:12 by arafel
If you have an API spy like SPY++ (comes with visual studio) you may want to spy the messages as your clicking different components to see what that (I believe it's a) Set/Change Focus message.
Posted on 2005-07-15 12:11:10 by r22
Ok, I have checked it with Spy++ and it reports that only BN_CLICKED sent when button being clicked.
Comparing this to messages sent when a regular button (direct child of dialog box) is clicked - BN_CLICKED followed by WM_SETFOCUS and WM_KILLFOCUS. I tried to manually change the focus when BN_CLICKED is received, but unsuccessfully? :sad:
Posted on 2005-07-15 16:19:25 by arafel
Fixed it. Only needed to create the controls with WS_EX_CONTROLPARENT style.
Posted on 2005-07-15 19:15:44 by arafel