Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to prevent Screen Saver from turning on

How to prevent Screen Saver from turning on

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    spiritofklanawa
    wrote on last edited by
    #1

    I'm generating an animation on the screen and the screen saver kicks in since there is no keyboard/mouse interaction from the user. Is there any MFC/Win32 to reset the screen saver timer ? Worst comes to worse I might try a SendMessage() with WM_COMMAND/BN_CLICKED periodically to simulate user interaction but there must be some more elegant solution. Thanks for your input Alex

    asta la vista baby

    PJ ArendsP M 2 Replies Last reply
    0
    • S spiritofklanawa

      I'm generating an animation on the screen and the screen saver kicks in since there is no keyboard/mouse interaction from the user. Is there any MFC/Win32 to reset the screen saver timer ? Worst comes to worse I might try a SendMessage() with WM_COMMAND/BN_CLICKED periodically to simulate user interaction but there must be some more elegant solution. Thanks for your input Alex

      asta la vista baby

      PJ ArendsP Offline
      PJ ArendsP Offline
      PJ Arends
      wrote on last edited by
      #2

      You could try using the SystemParametersInfo() function with the SPI_SETSCREENSAVEACTIVE action.


      You may be right
      I may be crazy
      -- Billy Joel --

      Within you lies the power for good, use it!!!

      Within you lies the power for good; Use it!

      1 Reply Last reply
      0
      • S spiritofklanawa

        I'm generating an animation on the screen and the screen saver kicks in since there is no keyboard/mouse interaction from the user. Is there any MFC/Win32 to reset the screen saver timer ? Worst comes to worse I might try a SendMessage() with WM_COMMAND/BN_CLICKED periodically to simulate user interaction but there must be some more elegant solution. Thanks for your input Alex

        asta la vista baby

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        Call SetThreadExecutionState(ES_DISPLAY_REQUIRED) to tell the system that you're using the display.

        --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Ford, what's this fish doing in my ear?

        PJ ArendsP 1 Reply Last reply
        0
        • M Michael Dunn

          Call SetThreadExecutionState(ES_DISPLAY_REQUIRED) to tell the system that you're using the display.

          --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Ford, what's this fish doing in my ear?

          PJ ArendsP Offline
          PJ ArendsP Offline
          PJ Arends
          wrote on last edited by
          #4

          From MSDN[^]: [quote] This function does not stop the screen saver from executing either. [/quote]


          You may be right
          I may be crazy
          -- Billy Joel --

          Within you lies the power for good, use it!!!

          Within you lies the power for good; Use it!

          M 1 Reply Last reply
          0
          • PJ ArendsP PJ Arends

            From MSDN[^]: [quote] This function does not stop the screen saver from executing either. [/quote]


            You may be right
            I may be crazy
            -- Billy Joel --

            Within you lies the power for good, use it!!!

            M Offline
            M Offline
            Michael Dunn
            wrote on last edited by
            #5

            Those docs need some cleanup, since they also say:

            Multimedia applications, such as video players and presentation applications, must use ES_DISPLAY_REQUIRED when they display video for long periods of time without user input.

            --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Ford, what's this fish doing in my ear?

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups