C ++热键运行功能 [英] C++ Hotkey to run function

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

问题描述

嘿,您希望将 F1 分配为运行功能的热键.我有一个带有Form的Windows 32项目,但是当我按 F1 时,该表单将在后台而不是活动窗口.

Hey looking to assign F1 as a hotkey to run a function. I have a windows 32 project with a Form, however the form will be in the background and not the active window when I press F1.

有没有一种方法可以编写热键或快捷方式,因此,即使Form1处于非活动状态,当我按 F1 时,它也会运行该功能?

Is there a way to code a hotkey or shortcut so when I press F1 it will run that function even if the Form1 isn't active?

推荐答案

看看它允许您定义系统范围的热键.按下热键后,即使您的窗口未处于活动状态,您也会收到一条WM_HOTKEY消息.

It allows you to define a system-wide hot key. When the hot key is pressed, you will receive a WM_HOTKEY message even if your window is not active.

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

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