没有在对话框proc中看到来自控件的焦点消息 [英] Not seeing focus messages from controls in a dialog proc
问题描述
(这是普通的Win32 C ++ - 没有MFC) 我在对话框资源的WM_INITDIALOG期间创建了一些标准控件,它只有一个Ok和Cancel按钮。我创建了WC_TABCONTROL,STATIC,EDIT等。 当按下相关的快捷键
时,我看不到任何焦点消息被发送到对话框proc,但这些应该通过带有NM_SETFOCUS的WM_NOTIFY来实现 - 好吧,根据文档。焦点确实会随着快捷键的变化而变化。
我错过了什么吗?我要做的是选择TabControl上的焦点,然后将键盘焦点设置为位于选项卡上的控件。
谢谢
杰克
>(这是普通的Win32 C ++ - 没有MFC )我在对话框资源的WM_INITDIALOG期间创建了一些标准控件,它只有一个Ok和Cancel按钮。我创建了一个WC_TABCONTROL,一个STATIC,一个EDIT等。当按下一个关联的快捷键
键时,我看不到任何焦点消息被发送到对话框proc,但是这些应该通过带有NM_SETFOCUS的WM_NOTIFY来实现 - 好吧,根据文件。焦点确实会随着快捷键的变化而变化。
看看Spy ++发生了什么 - 它可以节省你猜测的数小时。
Dave
(This is plain Win32 C++ - no MFC) I create a few standard controls during the WM_INITDIALOG of a dialog resource that just has an Ok and Cancel button. I create a WC_TABCONTROL, a STATIC, an EDIT etc. When an associated shortcut key is pressed I can't see any focus messages being sent to the dialog proc, yet these should come through on a WM_NOTIFY with a NM_SETFOCUS - well, according to the documentation. The focus does shift in response to the shortcut key.
Have I missed something ? What I am trying to do is to pick up a focus on the TabControl and then set the keyboard focus to a control that sits on the tab.
Thanks
Jack
>(This is plain Win32 C++ - no MFC) I create a few standard controls during the WM_INITDIALOG of a dialog resource that just has an Ok and Cancel button. I create a WC_TABCONTROL, a STATIC, an EDIT etc. When an associated shortcut key is pressed I can't see any focus messages being sent to the dialog proc, yet these should come through on a WM_NOTIFY with a NM_SETFOCUS - well, according to the documentation. The focus does shift in response to the shortcut key.
Have a look at what's going on with Spy++ - it'll save you hours of
guessing.Dave
这篇关于没有在对话框proc中看到来自控件的焦点消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!