问题描述
我编写了MFC(非对话框/单个文档)VC ++应用程序.
在initInstance中,我使用sleep(1000)
运行while(1)
.While(1)
检测到按键(大写锁定)并在系统托盘上显示一个图标(添加图标).
如果再次按下相同的键,则会从系统任务栏中删除该图标(删除图标).
通过调用Shell_NotifyIcon
(NIM_ADD/NIM_DELETE)完成添加和删除图标.
工作正常.但是,当具有(windows + L)的锁定系统并且在解锁该应用程序后没有响应时,我的意思是当我按下一个键并且在任务管理器中进行验证时,我的应用程序已在运行过程中列出,因此未添加图标标签.
为了调试,我使用了一些打印记录到磁盘文件.我观察到解锁打印未记录在磁盘文件中之后.
您能否为我提供一个建议,以使用户锁定和解锁后使我的应用程序正常工作.
谢谢您的期待
-Murty.
Hi,
I wrote a MFC (non dialog/single document) VC++ application .
In the initInstance , I’m running while(1)
with sleep(1000)
.While(1)
detects the key press (caps lock) and shows an icon (add icon) on the system tray.
If the same key is pressed again it removes the icon (delete icon) from system tray.
Adding and deleting icons is done by calling Shell_NotifyIcon
(NIM_ADD/NIM_DELETE).
It''s working fine. But, when a lock system with (windows + L ) and after unlock this application is not responding, I mean the icon is not added when I press a key and I verified in the Task manager to my surprise my application is listed in running process tab.
For debugging I used logging some prints to disk file. I observed after unlock prints are not logged in the disk file.
Can you help me with a suggestion to make my application work after lock and unlock of the User.
Thanking you with anticipation
-Murty.
推荐答案
这篇关于Windows锁定,解锁后,MFC系统托盘应用程序无响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!