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. Disable turning the screen off

Disable turning the screen off

Scheduled Pinned Locked Moved C / C++ / MFC
7 Posts 5 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.
  • A Offline
    A Offline
    aangerma
    wrote on last edited by
    #1

    Hello I would like to disable the outomatic turning off the screen, i.e. I want that the screen will always be on. I need that the project will be suitable also to windows xp accordingly, I can't use the function "RegisterPowerSettingNotification " . If anyone know another way to do it I would be glad if he can write it to me. thanks

    H L E 3 Replies Last reply
    0
    • A aangerma

      Hello I would like to disable the outomatic turning off the screen, i.e. I want that the screen will always be on. I need that the project will be suitable also to windows xp accordingly, I can't use the function "RegisterPowerSettingNotification " . If anyone know another way to do it I would be glad if he can write it to me. thanks

      H Offline
      H Offline
      Hans Dietrich
      wrote on last edited by
      #2

      You can use SystemParametersInfo() with the SPI_SETSCREENSAVEACTIVE parameter to control the screensaver. You may also need to use the same API with the SPI_SETPOWEROFFACTIVE parameter.

      Best wishes, Hans


      [Hans Dietrich Software]

      1 Reply Last reply
      0
      • A aangerma

        Hello I would like to disable the outomatic turning off the screen, i.e. I want that the screen will always be on. I need that the project will be suitable also to windows xp accordingly, I can't use the function "RegisterPowerSettingNotification " . If anyone know another way to do it I would be glad if he can write it to me. thanks

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        aangerma wrote:

        I would like to disable the outomatic turning off the screen,
        i.e. I want that the screen will always be on.

        Sounds like you need to notify someone of something important? I'm not always looking at a screen, and sometimes we even turn off the physical monitor. Now, if something is amiss, the machine starts beeping, and will keep beeping until someone goes check on it - beep was chosen because it's hooked to the internal speaker, and doesn't rely on the availability of a sound-card :)

        I are Troll :suss:

        A 1 Reply Last reply
        0
        • L Lost User

          aangerma wrote:

          I would like to disable the outomatic turning off the screen,
          i.e. I want that the screen will always be on.

          Sounds like you need to notify someone of something important? I'm not always looking at a screen, and sometimes we even turn off the physical monitor. Now, if something is amiss, the machine starts beeping, and will keep beeping until someone goes check on it - beep was chosen because it's hooked to the internal speaker, and doesn't rely on the availability of a sound-card :)

          I are Troll :suss:

          A Offline
          A Offline
          aangerma
          wrote on last edited by
          #4

          thank you for the reply, I need to desply on the monitor the calls from ills to nurse, I also uses sounds but I would prefere that the screen will be always on. thanks

          1 Reply Last reply
          0
          • A aangerma

            Hello I would like to disable the outomatic turning off the screen, i.e. I want that the screen will always be on. I need that the project will be suitable also to windows xp accordingly, I can't use the function "RegisterPowerSettingNotification " . If anyone know another way to do it I would be glad if he can write it to me. thanks

            E Offline
            E Offline
            Emilio Garavaglia
            wrote on last edited by
            #5

            In general, messing up the user settings of a system from an application is not a good idea. If the system is not used for that sole purpose, the user may have good reasons you cannot even imagine to keep the screen off (sometimes I even switch off the physical monitor!). By forcing it to be always on you're forcing a user system-requirement. Try thinking a user that uses your application and another one that -for reasons opposite to yours- want to force it off. What a mess! If the system is instead dedicated to your application (it will be in use for that only purpose ...) why not just configure it to have th screen always on, independently on your code?

            2 bugs found. > recompile ... 65534 bugs found. :doh:

            A 1 Reply Last reply
            0
            • E Emilio Garavaglia

              In general, messing up the user settings of a system from an application is not a good idea. If the system is not used for that sole purpose, the user may have good reasons you cannot even imagine to keep the screen off (sometimes I even switch off the physical monitor!). By forcing it to be always on you're forcing a user system-requirement. Try thinking a user that uses your application and another one that -for reasons opposite to yours- want to force it off. What a mess! If the system is instead dedicated to your application (it will be in use for that only purpose ...) why not just configure it to have th screen always on, independently on your code?

              2 bugs found. > recompile ... 65534 bugs found. :doh:

              A Offline
              A Offline
              aangerma
              wrote on last edited by
              #6

              The purpose of the system is that the nurse will be able to see the calls from distance, on screen that places on central place, if some one will change the settings of the computer the screen might turn off . thanks again.

              M 1 Reply Last reply
              0
              • A aangerma

                The purpose of the system is that the nurse will be able to see the calls from distance, on screen that places on central place, if some one will change the settings of the computer the screen might turn off . thanks again.

                M Offline
                M Offline
                Maximilien
                wrote on last edited by
                #7

                Ok, the context is now known. In such environment, hardware/software are regulated (by hospital authority) , and you should not have to deal with that, if a monitor needs to always be turned-on, then the admin will change the "power settings" to no go into power-saving mode (and probably the screen saver will be disabled for normal users). IMO, there should also be other means of communicating to the nurses (pagers, ... ). M.

                Watched code never compiles.

                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