Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to make MFC 6.0 dialog application such that user cannot do these tasks until it terminates.
1. Switch to any other application.
2. Open task manager.
3. Open start menu my pressing win key.
In other words, user must not be able to lose focus from that application and do any other task.
Posted

... humm... I don't want to be the user of your app, in case something will go wrong with it!
You eliminated all the chances to return in the control of my system!

The correct way is to make the dyalog System-Modal (see the WS_SYSMODAL style)

It will do what you asked (but allows Ctrl-Alt-Delete, in case something goes wrong)
 
Share this answer
 
Comments
Shah Rukh Qasim 21-Oct-10 9:31am    
Yeah, it works. I will rename taskmangager application to some other name on application's startup and restoring it's name on exit. Many thanks.
Emilio Garavaglia 22-Oct-10 7:55am    
DON'T DO THAT! if a bug in your application will make the user loosing control of it, there will be no chance to have back a working system. There are even possible legal troubles if a user is unable to recover by himself: he will say you modify his system without consensus, and you will be responsible of what, for the law, is nothing more than an information system attack.
Remember: for the current law, you don't own the system that run your application!
You need to hook the keyboard key When ever your application start.

this link help you to disable window key.
http://support.microsoft.com/kb/216893[^]
check another example.
http://www.codeproject.com/KB/cpp/ForTheKids.aspx[^]
 
Share this answer
 
As a general rule, always remember that it's your software, but it is not your computer: what you are going to do is avoiding the owner of the computer to do what he wants on it! Probably the most of people will dislike a feature like that!
 
Share this answer
 
Comments
Shah Rukh Qasim 21-Oct-10 9:27am    
I am not selling my application, just developing it for me and my computer.

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