Giter Club home page Giter Club logo

gamesuspender's Introduction

GameSuspender

Suspends processes while in the background to save laptop batteries

To do:

  • Either:
  • Add an easy way to force the suspender to run instead of another executable using Image execution options registry key
  • Perhaps even make an installer and uninstaller to make sure that if you use Image execution options, the registry keys are removed when you stop using the program
  • Measure the difference in battery use with and without the suspender

Inspiration

I made this application, both to play around with raw Win32 and when I started the project, to allow me to have games running in the background even if my old laptop was unplugged. I used to suspend games via Sysinternals Process Explorer, but that is tedious, so I wanted an automated way. With my new laptop, it's not really a big problem, but other people might benefit from this project.

How it works

Run it with a path to an executable as a parameter. It will then start that executable and start a timer that checks regularly if the process is in the foreground. If it's not in the foreground, we suspend all the threads of the application by misusing Windows debugging facilities. When you try to reactivate the process, the value for the foreground window becomes NULL and then we resume the process.

Note

  • The project in the solution called 'Target' is just a test application that the suspender starts when you start it via Visual studio.
  • Don't judge me on the code quality. It's a hack that was never intended to be released to the public. If I work on this some more, I'll make it pretty.

gamesuspender's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.