Solved

catch keyboard in screen saver

Posted on 2003-11-09
1
162 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

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