Solved

Disable ScreenSaver

Posted on 1997-08-07
5
408 Views
Last Modified: 2008-03-06
Hi, I am using Visual Basic 5.0 Pro.  How do I disable someones screensaver...and then re-enable it?
0
Comment
Question by:oreg
  • 2
  • 2
5 Comments
 
LVL 3

Expert Comment

by:ESI
ID: 1430043
What for ? Repaint or refresh problems in the forms ?
0
 

Author Comment

by:oreg
ID: 1430044
Nope...I wrote a 'HoT Corners' program.  I want to add the feature of disabling the screen saver when the mouse is in a 'hot corner'
0
 
LVL 3

Expert Comment

by:ESI
ID: 1430045
Maybe by setting it's delay to many many hours ?
0
 
LVL 5

Accepted Solution

by:
y96andha earned 20 total points
ID: 1430046
Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long
Public Const SPI_SETSCREENSAVEACTIVE = 17
Public Const SPIF_SENDWININICHANGE = &H2

Disable:

  SystemParametersInfo  SPI_SETSCREENSAVEACTIVE, 0, 0, SPIF_SENDWININICHANGE
                       
Enable:

  SystemParametersInfo  SPI_SETSCREENSAVEACTIVE, 1, 0, SPIF_SENDWININICHANGE
 

0
 
LVL 5

Expert Comment

by:y96andha
ID: 1430047
If you have trouble with the above declaration (directly from API reference) you can try this one instead:

Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Long, ByVal fuWinIni As Long) As Long
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

930 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

12 Experts available now in Live!

Get 1:1 Help Now