About Active Window And Receive Msg
-
There is a MFC-Based Application,his window tree structure as below: Root Parent Window Sub-Parent Window1:Edit、ComboBox Sub-Parent Window2:Edit、ComboBox、Static Sub-Parent Window3:ListCtrl、Progress Bar Sub-Parent Window4:Check Box Child Window4-1:Edit、ComboBox Child Window4-2:Edit、ComboBox **** I want to know if user click any window(including controls) or Get Focus,which message can Root parent window receive.
-
There is a MFC-Based Application,his window tree structure as below: Root Parent Window Sub-Parent Window1:Edit、ComboBox Sub-Parent Window2:Edit、ComboBox、Static Sub-Parent Window3:ListCtrl、Progress Bar Sub-Parent Window4:Check Box Child Window4-1:Edit、ComboBox Child Window4-2:Edit、ComboBox **** I want to know if user click any window(including controls) or Get Focus,which message can Root parent window receive.
Try the NM_SETFOCUS[^] and NM_CLICK notification messages.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > If it doesn't matter, it's antimatter.<
-
There is a MFC-Based Application,his window tree structure as below: Root Parent Window Sub-Parent Window1:Edit、ComboBox Sub-Parent Window2:Edit、ComboBox、Static Sub-Parent Window3:ListCtrl、Progress Bar Sub-Parent Window4:Check Box Child Window4-1:Edit、ComboBox Child Window4-2:Edit、ComboBox **** I want to know if user click any window(including controls) or Get Focus,which message can Root parent window receive.
Since you are using nonstandard nomenclature, please define Root Window, Sub window and Child window. What is relationship between all windows? In general message about gaining focus (by any means including mouse click) is sent to a window that is gaining focus and loosing focus. If this window is a child window, the parent does not know about what child gained focus. You have two choices: write code in the child window to notify parent window about gaining focus using custom defined message, or write windows hook that will receive messages before any window does and post a message from the hook procedure to a parent window. In both cases you would pass a handle to a window that gains focus.
JohnCz