Results 1 to 2 of 2

Thread: Start Screensaver in win95 and win98

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 1999
    Posts
    6

    Post

    Hi, I really need code that can start the default screensaver in both windows 95 and 98. but so far all the code i found starts the screensaver in win95 but activates the suspend mode in win98! does anybody have any idea on how i can accomplish starting the default screensaver in both versions of windows? maybe i could access the registry to find the default screensaver or something... any ideas are much needed! thanks in advance

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Works fine for me under Win98:

    Code:
    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 Declare Function GetDesktopWindow Lib "user32" () As Long
    Const WM_SYSCOMMAND = &H112&
    Const SC_SCREENSAVE = &HF140&
    
    Public Sub ActivateScreenSaver()
        
        Dim ret As Long 'junk return value
        Dim desktop As Long 'desktop handle
        desktop = GetDesktopWindow
        ret = SendMessage(desktop, WM_SYSCOMMAND, SC_SCREENSAVE, 0&)
        
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width