Solved

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

Posted on 1998-05-18
6
323 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
ID: 1164227
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
ID: 1164228
Thanks Norbert for answering my question. However, my program will be running on Windows NT.
0
 

Expert Comment

by:unmeshv
ID: 1164229
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 1

Expert Comment

by:ElmerFud
ID: 1164230
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
ID: 1164231
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
ID: 1164232
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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
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 viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

810 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