热键未发送 [英] Hot key not sent

查看:80
本文介绍了热键未发送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经设置了一个热键:

RegisterHotKey(g_hWnd, g_iHotKeyID, HOTKEYF_ALT | HOTKEYF_CONTROL, 0x42);



该函数返回的值不为零,因此成功.

在g_hWnd的窗口proc中,我添加了:

switch(msg)
{
...
   case WM_HOTKEY:
   {
     MessageBox(NULL, "HOT KEY PRESSED", "", 0);
     return TRUE;
   }
...
}



但是我没有收到消息!而且Spy ++不会显示WM_HOTKEY消息!

有人可以提示我从哪里开始搜索吗?

可能是什么问题呢?窗口是否需要满足特定的属性?

问候,

解决方案

我有解决方法!

使用MOD_ALT而不是HOTKEYF_ALT等.

Hi,

I have set a hot key with:

RegisterHotKey(g_hWnd, g_iHotKeyID, HOTKEYF_ALT | HOTKEYF_CONTROL, 0x42);



The function returns not zero, so it is successful.

To the window proc for g_hWnd I added:

switch(msg)
{
...
   case WM_HOTKEY:
   {
     MessageBox(NULL, "HOT KEY PRESSED", "", 0);
     return TRUE;
   }
...
}



But I do not receive the message! Also Spy++ does not show the WM_HOTKEY message!

Can anybody give me a hint where to start searching?

What could be the problem? Does the window need to satisfy specific properties?

Regards,

解决方案

I have the solution!

Use MOD_ALT instead of HOTKEYF_ALT etc.!!


这篇关于热键未发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆