Solved

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

Posted on 1998-05-18
6
321 Views
Last Modified: 2006-11-17
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.
 
0
Comment
Question by:rosetalk
6 Comments
 
LVL 3

Expert Comment

by:Norbert
Comment Utility
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
0
 

Author Comment

by:rosetalk
Comment Utility
Thanks Norbert for answering my question. However, my program will be running on Windows NT.
0
 

Expert Comment

by:unmeshv
Comment Utility
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.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Expert Comment

by:ElmerFud
Comment Utility
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.
0
 

Author Comment

by:rosetalk
Comment Utility
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.  
0
 
LVL 1

Accepted Solution

by:
Arkadiy earned 100 total points
Comment Utility
Check out if this helps:
-------------------------------
By giving a macro a special name, you can run it automatically when you perform an operation such as starting Word or opening a document. Word recognizes the following names as automatic macros, or "auto" macros.

Macro name      When it runs
AutoExec      When you start Word
AutoNew      Each time you create a new document
AutoOpen      Each time you open an existing document
AutoClose      Each time you close a document
AutoExit      When you quit Word
----------------------------------
This is from Word 95 help. Word 97 probably has something even more elaborate in its VBA.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now