Start a screen saver from your code !!!

By | 2002-06-01

This code, you may insert in your program, allows to start a screensaver.
Many other usefull solutions you’ll find on my site: http://www.netcity.ru/~timur555/
Glad to see you !!!

Original Author: Timur

API Declarations

Private Declare Function SendMessage Lib “User32” Alias “SendMessageA” ( _
ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
Private Const WM_SYSCOMMAND = &H112&
Private Const SC_SCREENSAVE = &HF140&

Code

'Place this two lines of code any where in your program
'...
'enjoy!
Dim tmp As Long
tmp = SendMessage(Me.hWnd, WM_SYSCOMMAND, SC_SCREENSAVE, 0&)

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.