How to activate Screen Saver? 
Author Message
 How to activate Screen Saver?

Hi,
Does anyone have a routine/procedure to activate Screen Saver from a VB
Menu?
Thanks

--
Regards,
Koh Cheng Soon
(65)-3734889; Fax (65)-2754369



Wed, 10 Dec 2003 11:31:06 GMT  
 How to activate Screen Saver?
There is an API guide available at www.allapi.net
The calling routine is as follows

Declarations

#If Win32 Then

    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

    Const WM_SYSCOMMAND = &H112&
    Const SC_SCREENSAVE = &HF140&

#Else

    Private Declare Function SendMessage Lib "User" _
    (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal _
    wParam As Integer, lParam As Any) As Long

    Const WM_SYSCOMMAND = &H112
    Const SC_SCREENSAVE = &HF140&

#End If

Code

To start the screen saver, use the following code:

Dim result As Long
result = SendMessage(Form1.hWnd, WM_SYSCOMMAND, SC_SCREENSAVE, 0&)

Quote:
> Hi,
> Does anyone have a routine/procedure to activate Screen Saver from a VB
> Menu?
> Thanks

> --



Sat, 13 Dec 2003 14:36:25 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Activate Screen Saver with VB.Net

2. Activating the Win95 Screen Saver

3. Activating screen saver in NT 4.0

4. Activating an OLE Screen Saver

5. Activating the Win95 Screen Saver

6. A message for screen saver activating.

7. activate a screen saver on NT system

8. Activating Windows 98 Default Screen Saver

9. Screen Saver on top of Screen Saver problem

10. screen saver & screen 9

11. Using StretchBlt to capture screen image to screen saver preview pane

12. Shifting Screen screen saver?

 

 
Powered by phpBB® Forum Software