简体   繁体   English

Win32 API GetMessage()

[英]Win32 API GetMessage()

I want to change the default behaviour of a combobox (c++, win32 api). 我想更改组合框的默认行为(C ++,Win32 API)。 I make the combobox drop down when something is entered in its edit control I want to avoid the default behaviour that the combobox searches for the first match in the list, selects it, and enters the selected string into the edit control. 在组合控件中输入某些内容时,我使组合框下拉。我想避免默认行为,即组合框搜索列表中的第一个匹配项,将其选中,然后将选定的字符串输入到编辑控件中。 Can I suppress this behaviour by catching the respective (LB_SETCURSEL etc.) messages out of the message queue myself with GetMessage()? 我可以使用GetMessage()从消息队列中捕获相应的消息(LB_SETCURSEL等)来抑制此行为吗?

Does anyone habe a different idea of how to do it? 有人对如何做有不同的想法吗?

Greets Michbeck 向米贝克致意

You likely want to implement Window subclassing . 您可能想实现Window子类化 This allows you to insert your own WndProc function into the combobox control that gets called before the control's own WndProc is called. 这使您可以将自己的WndProc函数插入到在调用控件自己的WndProc之前被调用的组合框控件中。 You can filter out (and drop) window messages you don't want the control to get. 您可以过滤(拖放)您不希望控件获取的窗口消息。

I'm not booted into my windows partition right now to run Spy++ on a combobox to see what messages it actually receives. 我现在还没有启动到Windows分区中,无法在组合框上运行Spy ++,以查看其实际收到的消息。 My guess is that you want to filter out WM_CHAR from being received by the combobox. 我的猜测是您想从组合框接收到的消息中过滤掉WM_CHAR。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM