shutdown

libevent buffered events and half-closed sockets

It is simple to implement a TCP port mapper using bufferevent_* functions of libevent. However, the documentation states that "This file descriptor is not allowed to be a pipe(2)" and I doubt if it can handle the case of when we can only read or only write to a file descriptor. Will libevent work correctly if the socket is shutdown in ...

Java: how can I react to computer shutdown in windows xp?

Hi! Is it possible make some handler that will do something when user shutdown computer with Java on Windows XP (optional, win7)? How? Thanks. ...

Block windows shutdown

Hi! I need execute some code before Windows shutdown process each time. So, I want block Windows shutdown process for some time. How can i do it from Java or C++ Builder ? Thanks. ...

Windows Services dependencies on shutdown?

Hello everyone I have a Windows Server 2003 and I have a windows service A which depends on a second service B. Service A is created by me, and service B is SQL Server 2008, so my service needs to save data into the database using SQL Server when Windows is shutting down. The problem is that sometimes, SQL Server is killed before my ser...

Shutdown and WakeUp Script C#

Hiya I am very new to C#, infact this is basically my first task set by work whilst i learn the language. Yes i am also new to programming, be gentle :). Context: My script needs to query active directory, grab of OU's and put them to a combo box in a form. Next query ActDir for a list of machines in a selected OU (Done this in a vbscri...

On a Mac how to determine a user logout is occuring

Hello All, I am very new to the Mac platform and Objective-C in general and in my application I would like to know how to determine that a user is logging out and perform some actions prior to this. Any info or pointers for this will be greatly appreciated. Regards, -Jim ...

OS Reboot, Shutdown, Hibernate, Sleep, Wakeup (Windows Python)

Hi, I'm looking for an automatize way of doing Windows Power Management functions: - Reboot - Shutdown - Hibernate - Sleep - Wakeup Is there a Python module to cover this functionality? Of course any other solutions are also appreciated... ...

Win32 API prevent standby

What is the Win32 api function that prevents the system from going into standby? Some programs use it, which is pretty annoying in my opinion. I know there's a couple of WM_SYSCOMMAND messages you can trap to prevent the screensaver from coming on.. ...

aborting computer shutdown from windows service

Hi, Is it possible to abort computer shutdown from windows service? ...

Add windows commands in python

Can anyone tell me how to add the shutdown.exe to python and how . i also want to set and variables like shutdown.exe -f -s -t 60 ...

How to exit a WPF app programmatically?

Hi All In the few years I've been using C# (WINFORMS), I've never used WPF. But now I love WPF, but I don't know how the hell I am supposed to exit my application when the user clicks on the Exit menu item from the File menu. Can somone please help me out!? I DID google this, and guess what? For such a Simple? thing... Nothing related ...

WMI to reboot remote machine

I found this code on an old thread to shutdown the local machine: using System.Management; void Shutdown() { ManagementBaseObject mboShutdown = null; ManagementClass mcWin32 = new ManagementClass("Win32_OperatingSystem"); mcWin32.Get(); // You can't shutdown without security privileges mcWin32.Scope.Options.EnableP...

Application.Current.Shutdown() vs. Application.Current.Dispatcher.BeginInvokeShutdown()

First a bit of background: I have a WPF application, which is a GUI-front-end to a legacy Win32-application. The legacy app runs as DLL in a separate thread. The commands the user chooses in the UI are invoked on that "legacy thread". If the "legacy thread" finishes, the GUI-front-end cannot do anything useful anymore, so I need to shut...

Shutdown Windows with Java

Hey, Is it possible to shutdown Windows programmatically with Java? Cheers ...

Android GPS app not closing connection

Hi there, Fairly new to Android, so just trying to work out: I have a simple Maps app that plots a couple of locations. It's a demo for a potentially bigger app later. The one thing I would like to do is make it exit correctly. I want to assume that when a user hits the "Home" or "Back" button on the phone, that they have exited the ap...

How do you close an application when some WaitHandle is in the middle of a call to WaitOne?

Is there a standard way to close out an application "cleanly" while some WaitHandle objects may be in the state of a current blocking call to WaitOne? For example, there may be a background thread that is spinning along in a method like this: while (_request.WaitOne()) { try { _workItem.Invoke(); } finally {...

Gracefully shutting down a Java OpenGL (JOGL) app

I have an application with a JOGL component. When it shuts down using System.exit(0), I frequently get the exception: java.lang.InterruptedException at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134) at sun.java2d.Dispose...

java swing program not closing after dispose is called on last window

Preface: This is the first real swing program I have done. I have a swing program, where one JButton is supposed to exit the program. That button triggers this.dispose();. When i click this JButton, it does make the window completely go away, but looking at the debugger, the program itself is still running. My main method only consists...

Detecting windows shutdown event

I have a windows Service always running once PC started, how would i detect using .NET 3.5 or WMI, when the user or some other application/process has requested a shutdown or reboot in windows. I do not want to stop it, just log the time and who initiated the shutdown (user or process is fine, don't really need to know which process) T...

canceling timers during weblogic shutdown

hi all i have an EAR project which runs on weblogic i have some timers in my application and i want to cancel them when i redeploy my EAR project. I have tried using PhaseListener but i could not access to my web module classes in phase listener. how could i do this task? thanks in advance ...