Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Disable ScreenSaver

Posted on 1997-08-07
5
Medium Priority
?
419 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 80 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…
Suggested Courses

610 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