Click here to Skip to main content
15,907,326 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

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
Updated 22-Dec-10 22:03pm
JF2015 23-Dec-10 4:03am    
Edited to improve readability.

1 solution

may be You are not able to receive the keyboard message, because your window is not active
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900