Git Product home page Git Product logo

os-shutdown-winapi's Introduction

Handling the OS shutdown event using WinAPI

About

This project is a collection of three utilities illustrating detection and handling the OS shutdown events using WinAPI for console applications, GUI applications, and services.

We need to detect computer shutdown event to correctly finish the work of our applications, in particular:

  • Save all needed data,
  • If we have a network distributed system, we should notify all its components that this current component will be shut off,
  • Update internal event log adding record about the component shutdown.

Implementation

C++ (Visual Studio) is used.

Console applications: The implementation is based on the corresponding WinAPI events handling. GUI applications: The implementation is based on handling WM_QUERYENDSESSION and WM_POWERBROADCAST window messages. Services: Implemented mechanism is pretty much the same as the one used for console applications, but has its specifics in creating and registering callback functions and Windows event handling.

For more detailed tutorial and example explanations, please read the related article.

License

Licensed under the MIT license. © Apriorit.

os-shutdown-winapi's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.