Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用标准热键控件来允许用户为某个操作指定组合键。但是,它不允许使用 Return (Enter) 键。有没有办法允许它?我的操作是一种聊天回复,因此使用 Alt+Enter 之类的热键是最有意义的。
唯一的方法是对控件进行子类化,因为默认情况下它拒绝像VK_RETURN.
VK_RETURN
您的子类可能需要做两件事:
WM_GETDLGCODE
DLGC_WANTMESSAGE
WM_KEYDOWN
HKM_SETHOTKEY