Link to home
Start Free TrialLog in
Avatar of rosetalk
rosetalk

asked on

How to track Ctrl+Alt+Del and Ctrl+Break?

I believe u may have read about my question on how to use DDE to communicate with Word 97. I have manage to solve the problem by using DDE to open the template with the visual basic commands  that I have record in Word 97. My objectives of inserting a picture as a watermark in a word document and printing it out are achieved.

However, this picture that is inserted must not be available or accessed by the user. This picture resides in the Oracle database and password to access the picture must be specified before a word document can be printed with this picture as a watermark in it.

In the macro that is used to print the watermark, I include a statement to exit Word 97 without saving the document so that the picture that inserted in the document will not be available when the document is retrieve again. However, users can still hack the program and obtain the picture file. They can do so by performing the Ctrl+Alt+Del key strokes during the process of printing the watermark. The task manager will be activated and the user can force the word document to open and thus obtain the picture file which is already inserted in the document. The user can also control break to open the word document while the program is in the progress of printing the watermark.

My question is how to trap these key strokes and quit Word 97 on detecting them. Thus, the user will have no chance to open the word document.
 
Avatar of Norbert
Norbert
Flag of Germany image

If you are using win 95
SystemParametersInfo (SPI_SCREENSAVERRUNNING, 1,nOldVal, 0);//Turns keys off
SystemParametersInfo (SPI_SCREENSAVERRUNNING, 0, &nOldVal, 0);//Turns keys on

This would disable..all alt+tab. ctrl+alt+Del...etc. etc.
I hope that helps
    Norbert
Avatar of rosetalk
rosetalk

ASKER

Thanks Norbert for answering my question. However, my program will be running on Windows NT.
I have a solution for trapping Ctrl+Break  using Interrupt Service Routine in C++. But I havent read about ur previous question and hence I am not sure wether u are carrying out implementation in visual basic or C++. If in C++ please write back accordingly.
rosetalk, I'm sorry to inform you that this is impossible.  On Windows NT, the Ctrl + Alt + Delete keys are burried so fa into the OS that the eveent dosen't even go into a single message queue.  Ctrl + Break however isn't sush a key stoke.  I have a program "keyboard express" which run under NT and I use to automate a lot of tasks.  It can not pass Ctrl + Alt + delete because of this very same reason.  Do a net search for Keyboard express, find the author, drop him an e-mail and i'm sure he could go into the detail of why this is impossible.
Thanks to Elmerfud and unmeshv for your comments. I won't be doing the Ctrl + Alt + Delete problem. I heard that it is still possible to trap the keystrokes. It got to do with the gina.dll file. I also heard that it is very difficult to do and it is not mean for normal programmers. Anyway, I really appreciate you guys for trying to help.  
ASKER CERTIFIED SOLUTION
Avatar of Arkadiy
Arkadiy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial