Blocking a log off request with Python

I have some software that occasionally logs me off automaticly. I want to block this, so I won't be logged off (windows 7). Are there a way to block log off requests using Python? If so, then how and if not; are there any other solutions?


Looks as if there's a possible solution in an MSDN article.

What you'd have to do is write a simple Windows application which handles the WM_QUERYENDSESSION event, and returns FALSE, then, in theory, as long as that application is running, the system won't log you out. It's possible that just leaving open an instance of notepad.exe with an unsaved file in it would achieve the same thing.

It, might, however, cause all other applications to terminate, so, if that's undesirable, you'd have to intercept the call to ExitWindows from softXpand, which is much more complicated.

Some security products like Comodo Internet Security will allow you to run an application in a sandbox, such that you can intercept and deny certain system calls, which might work.

See also: this question.

Need Your Help

Controlling event-driven navigation in a WPF application

c# wpf event-handling

I think the title for this question is probably wrong, but I'm not sure quite how to phrase it. I have a C# 4.0 (VS2010) WPF application.

Create a Jenkins Matrix Job with parameters based on files present in folder or shell script output

bash matrix jenkins properties

I am trying to create a Matrix Configuration job in Jenkins based on the files present in a directory on the host machine.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.