Solved

API call for Windows2000 to lock the keyboard

Posted on 2004-08-16
2
321 Views
Last Modified: 2013-11-13
Hi,
I have created a VB application to lock the computer (VB6) using the
following APIS:
clipcursor
getwindowrect
systemparamtersinfo (SPI_SCREENSAVERRUNNING)

The mechanism is that when the user locks the windows, the getwindowrect API gets the rectangular region of the form and clips the cursor so that it cannot move on the desktop. The Systemparamtersinfo API then locks the keyboard until the user enters the required password in the vb6 application. This app works fine under windows 98. However, under windows 2000 the systemparametersinfo(SPI_SCREENSAVERRUNNING) doesnot work. As a result,
the keyboard shortcuts such as CTL-ALT-DEL and CTL-TAB work even when
my VB6 application has locked the cursor within the rectangular region
of the form. Is there any alternative to the Systemparametersinfo API
that can do the lock the keyboard (not to the application but to
the rest of the windows)

THnaks
Rafay
0
Comment
Question by:rbali2004
2 Comments
 
LVL 11

Expert Comment

by:Jase-Coder
ID: 11813218
0
 
LVL 2

Accepted Solution

by:
zonaltech earned 125 total points
ID: 11830677
Here's an example project that uses the keyboard hooking and mouse restriction you are talking about:

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=54463&lngWId=1

It disables low level keys in NT, 2000, and XP.

Hope it helps!
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.

831 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