Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement prevent shutdown / sign out procedure #19745

Open
3 tasks done
cberescu opened this issue Aug 14, 2019 · 0 comments
Open
3 tasks done

feat: implement prevent shutdown / sign out procedure #19745

cberescu opened this issue Aug 14, 2019 · 0 comments

Comments

@cberescu
Copy link

cberescu commented Aug 14, 2019

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.
    (there was something like this but has been closed, i hope this will receive a new consideration)

Problem Description

OS : Windows

I would like a way to prevent windows sign out/shutdown until i finish/stop my running tasks.

Proposed Solution

Add the following functions

app.preventShutDown(reason)

When it is called the following should happen:
[ ] call the ShutdownBlockReasonCreate API to prevent the shutdown.
[ ] all windows that receive the WM_QUERYENDSESSION event should return false

app.releaseShutDown()

This function should call ShutdownBlockReasonDestroy witch will allow the sign out/shutdown of windows.

Alternatives Considered

For now the method i use to achieve this result is using the node-ffi addon. But that is a complicated and not very efficient method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants