[size=-2]------ Добавлено в 17:49
Короче так. Есть такой uber-message, зовётся WM_COMMAND, и позволяет он, в числе прочего, пролучать notifications (уведомления) от контролов, что с ними происходит. В частности, есть такой notification - CBN_SETFOCUS:
MSDN писал(а):
The CBN_SETFOCUS notification message is sent when a combo box receives the keyboard focus. The parent window of the combo box receives this notification message through the WM_COMMAND message.
Более того, есть ещё уйма его "коллег" по типу элемента - в частности, CBN_SELCHANGE, перехват которого куда корректнее для целей отлова изменения выделения в CBOx-е, чем onClick.
[size=-2]------ Добавлено в 17:51
Да, для справки - WM_COMMAND:
MSDN писал(а):
WM_COMMAND Notification
--------------------------------------------------------------------------------
The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated.
Syntax
WM_COMMAND
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The high-order word specifies the notification code if the message is from a control. If the message is from an accelerator, this value is 1. If the message is from a menu, this value is zero.
The low-order word specifies the identifier of the menu item, control, or accelerator.
lParam
Handle to the control sending the message if the message is from a control. Otherwise, this parameter is NULL.
Return Value
If an application processes this message, it should return zero.
Remarks
Accelerator keystrokes that select items from the window menu are translated into WM_SYSCOMMAND messages.
If an accelerator keystroke occurs that corresponds to a menu item when the window that owns the menu is minimized, no WM_COMMAND message is sent. However, if an accelerator keystroke occurs that does not match any of the items in the window's menu or in the window menu, a WM_COMMAND message is sent, even if the window is minimized.
If an application enables a menu separator, the system sends a WM_COMMAND message with the low-word of the wParam parameter set to zero when the user selects the separator.
Windows 98/Me, Windows 2000/XP: If a menu is defined with a MENUINFO.dwStyle value of MNS_NOTIFYBYPOS, WM_MENUCOMMAND is sent instead of WM_COMMAND.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1
[size=-2]------ Добавлено в 17:53
Только вот не знаю, как в нашем случае (создание контролов "на лету") его прикрутить.
Dilma, Galkov, что скажете - есть возможность?