Results 1 to 8 of 8

Thread: How to supress the screensaver? ::resolved::

  1. #1

    Thread Starter
    Fanatic Member arsmakman's Avatar
    Join Date
    Dec 2001
    Location
    Leiden, Netherlands.
    Posts
    719

    Question How to supress the screensaver? ::resolved::

    Hi-di-ho programmeréro's!

    I'm making this movie player, but the screensaver just keeps poppin up, very annoying...
    So my question is: how can I supress (or dis- and enable) the screensaver?

    Thanx and cheers,
    Alexander.
    Last edited by arsmakman; Feb 23rd, 2004 at 09:06 AM.
    No matter how fool-proof your program is, there will always be a better fool.

    Was a post helpful to you? Rate it!

  2. #2
    Fanatic Member laserman's Avatar
    Join Date
    Jan 2002
    Location
    Wales U.K
    Posts
    775
    Why don,t you set the screensaver to none in the properties window of windows.

    Hope im on the right lines for you

    Cheers

  3. #3

    Thread Starter
    Fanatic Member arsmakman's Avatar
    Join Date
    Dec 2001
    Location
    Leiden, Netherlands.
    Posts
    719
    Originally posted by laserman
    Why don,t you set the screensaver to none in the properties window of windows.

    Hope im on the right lines for you

    Cheers
    Sorry, you're not on the right lines for me. I really need my program to disable the screensaver. Other people are going to use this program, I can't expect them all to turn off their screensavers...
    No matter how fool-proof your program is, there will always be a better fool.

    Was a post helpful to you? Rate it!

  4. #4
    Fanatic Member laserman's Avatar
    Join Date
    Jan 2002
    Location
    Wales U.K
    Posts
    775
    Yes Sorry though it was more than that.

    I think there are a few little programs floating around.

    Have you done a search?

    Cheers

  5. #5

    Thread Starter
    Fanatic Member arsmakman's Avatar
    Join Date
    Dec 2001
    Location
    Leiden, Netherlands.
    Posts
    719
    I've searched on the forum, couldn't find anything. But I'll check the web.
    No matter how fool-proof your program is, there will always be a better fool.

    Was a post helpful to you? Rate it!

  6. #6

    Thread Starter
    Fanatic Member arsmakman's Avatar
    Join Date
    Dec 2001
    Location
    Leiden, Netherlands.
    Posts
    719
    Found something:

    VB Code:
    1. 'Author: Waty Thierry
    2. 'Origin:  <a href=\"http://www.geocities.com/ResearchTriangle/6311/\" target=\"_blank\">[url]http://www.geocities.com/ResearchTriangle/6311/[/url]</a>
    3. 'Purpose: Activate/Deactivate the Screen Saver
    4. 'Version: VB4+
    5.  
    6. Option Explicit
    7. Private Const SPI_SETSCREENSAVEACTIVE = 17
    8. Private Const SPIF_UPDATEINIFILE = &H1
    9. Private Const SPIF_SENDWININICHANGE = &H2
    10.  
    11. Private Declare Function SystemParametersInfo Lib "user32" _
    12. Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal _
    13. uParam As Long, ByVal lpvParam As Long, ByVal fuWinIni As _
    14. Long) As Long
    15.  
    16. Public Function ToggleScreenSaverActive(Active As Boolean) _
    17.    As Boolean
    18.  
    19. 'To Activate Screen Saver, set active to true
    20. 'to deactivate, set active to false
    21.  
    22. Dim lActiveFlag As Long
    23. Dim retval As Long
    24.  
    25. lActiveFlag = IIf(Active, 1, 0)
    26. retval = SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, _
    27.    lActiveFlag, 0, 0)
    28. ToggleScreenSaverActive = retval > 0
    29.  
    30. End Function
    31.  
    32. Private Sub Form_Load()
    33.  ToggleScreenSaverActive False
    34. End Sub
    35.  
    36. Private Sub Form_Unload(Cancel As Integer)
    37.  ToggleScreenSaverActive True
    38. End Sub

    It works.

    No matter how fool-proof your program is, there will always be a better fool.

    Was a post helpful to you? Rate it!

  7. #7
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    No offense, but I hate it when a program changes my OS settings. What if the user opens your software and then walks away for several hours? I'd want my screensaver to be up when I come back.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  8. #8

    Thread Starter
    Fanatic Member arsmakman's Avatar
    Join Date
    Dec 2001
    Location
    Leiden, Netherlands.
    Posts
    719
    Originally posted by ober5861
    No offense, but I hate it when a program changes my OS settings. What if the user opens your software and then walks away for several hours? I'd want my screensaver to be up when I come back.
    I'll change the code so the screensaver lock will only be on while playing.
    It doesn't appear to be that hard: "ToggleScreenSaverActive True"
    No matter how fool-proof your program is, there will always be a better fool.

    Was a post helpful to you? Rate it!

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