我想要对软件加上一个系统快捷键(就是在本程序未获得焦点时也一样可以使用这个快捷键调度本软件)
比如我定义为 Ctrl+P 则当程序在后台运行时一样可以实现停止的工作(当然用这个快捷时调用的函数是我自己写)
我只想知道用什么方法在基于Dialog的程序上能实现 系统快捷键
当然要是能来一个系统托盘就更好了。
谢谢
版主大侠们帮我呀。
全局钩子代码:
托盘的制作:
Shell_NotifyIcon
This function sends a message to the system to add, modify, or delete an icon from the taskbar status area.WINSHELLAPI BOOL WINAPI Shell_NotifyIcon(
DWORD dwMessage,
PNOTIFYICONDATA pnid );
Parameters
dwMessage
[in] Specifies the message value to send. It is one of these values:
Value Description
NIM_ADD Adds an icon to the status area.
NIM_DELETE Deletes an icon from the status area.
NIM_MODIFY Modifies an icon in the status area.
pnid
[in] Pointer to a NOTIFYICONDATA structure. The content of the structure depends on the value of dwMessage.
Return Values
Nonzero indicates success. Zero indicates failure.