Solved

catch keyboard in screen saver

Posted on 2003-11-09
1
160 Views
Last Modified: 2010-05-01
i wrote a screensaver in visual basic (with a password) and i have a problem in win 9X.
when the user presses the alt-tab or ctrl-esc it displays the desktop. i wish to catch that before windows and tell windows not to handle the keypress.
i am looking for a code that does that.
0
Comment
Question by:dvirw
1 Comment
 
LVL 28

Accepted Solution

by:
vinnyd79 earned 250 total points
ID: 9710256
command1 will disable,command2 enable:

Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long
    Private Const SPI_SCREENSAVERRUNNING = 97

Private Sub Command1_Click()
SystemParametersInfo SPI_SCREENSAVERRUNNING, True, False, 0
End Sub

Private Sub Command2_Click()
SystemParametersInfo SPI_SCREENSAVERRUNNING, False, False, 0
End Sub
0

Featured Post

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

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

744 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

13 Experts available now in Live!

Get 1:1 Help Now