suspend

Run script on suspend/resume in Mac OS X

Is there any way to automatically run a script on suspend/resume (i.e. when I close the lid, or after opening it) under Mac OS X 10.4? ...

WinForms: Best way to suspend control events?

This seems like a very simple and a very common problem. The simplest example I can think of is this. The form has 5 checkboxes with a "check all/check none" checkbox above them. When a user selects the check all checkbox I toggle the states of the "children" - obviously I don't want to fire the check events of all the children until I a...

MFC, c++ When showing and hiding ctrls on the screen can I disable paint for a bit.

I have a screen with say 20 controls on it. I want to show all twenty, then hide only the ones that don't relate to what I'm working on. psudoCode. for each element show element for each element in hide list hide element. My problem is that between the loops the screen paints. It looks very ugly. I know I've seen this do...

How can I run code on Windows Mobile while being suspended?

I'd like to run some C++ code while the Windows Mobile PocketPC is (or seems) being suspended. An example what I mean is the HTC Home plugin that shows (among others) a tab where the HTC Audio Manager can be used to play back mp3 files. When I press the on/off button, the display goes black, but the audio keeps playing. The only button t...

How can I detect suspend on Windows Mobile?

We are seeing some occasional data loss with our application on Windows Mobile, and we suspect that some buffered data is not being flushed to disk when the device is suspending. We would like to manually flush data to the disk when the device is about to suspend. On Windows, we do this by catching the WM_POWERBROADCAST message, but this...

WASAPI prevents Windows automatic suspend?

First time poster, be gentle ;-) I'm writing an audio app (in C++) which runs as a Windows service, uses WASAPI to take samples from the line in jack, and does some processing on it. Something I've noticed is that when my app is "recording", Windows won't automatically suspend or hibernate. I've registered for power event notificatio...

How to Suspend a button event in C#?

In my application I want to suspend a button event for some time so that I can fire another event after which the first button event will resume. In c# I am not getting how do I perform it using threads asynchronously. Please help. Thanks in advance.. ...

Bash date/time arithmetic

I have a little Bash script which suspends the computer after a given number of minutes. However, I'd like to extend it to tell me what the time will be when it will be suspended, so I can get a rough idea of how long time I have left so to speak. #!/bin/sh let SECS=$1*60 echo "Sleeping for" $1 "minutes, which is" $SECS "seconds." slee...

OS X Process control

I'm writing a process-controller kernel extension for leopard. The application enables me to suspend process's with SIGSUS and to make the computer sleep. My problem is when an application that uses video / audio (e.g iTunes or GarageBand) is suspended and then I try to make the computer sleep, the sleep process waits on the audio / vide...

Temporarily suspend the PC operating system.

How does one programmatically cause the OS to switch off, go away and stop doing anything at all so that a program may have complete control of a PC system? I'm interested in doing this from both an MS Windows and Linux environments. Any languages or APIs considered. I want the OS to stop preempting my program, stop its virtual memory...

Suspending the execution of a remote process (C, Windows)

I can suspend a thread of another process by using SuspendThread(). Is there any way to also suspend the execution of that process altogether? If yes, please post code. Thanks. PS: Since you will ask "Why do you want to do this" I'll post it here. I am dealing with legacy software that is not maintained anymore. I don't have access to ...

JScript Wait function

I have a function written in JScript (Not javascript) I need to suspend until a certain global variable becomes true. The global variable is changed to true when another function is called after an ajax response: function(req, event, data) { globalVariable = true; } When I try to loop until the variable is true: while (globalVaria...

Suspended status in SQL Activity Monitor

What would cause a query being done in Management Studio to get suspended? I perform a simple select top 60000 from a table (which has 11 million rows) and the results come back within a sec or two. I change the query to top 70000 and the results take up to 40 min. From doing a bit of searching on another but related issue I came ...

Request suspend on Vista but allow other applications to cancel

My application uses the Win32 SetSuspendState() API to trigger system suspend or hibernation when it has finished doing a lengthy task. The API accepts a parameter "ForceCritical" which determines whether or not the system suspends immediately or whether it broadcasts PBT_APMQUERYSUSPEND first to allow other apps the chance to cancel th...

Resuming C# threads

Possible duplicate question: http://stackoverflow.com/questions/142826/is-there-a-way-to-indefinitely-pause-a-thread In my code i do the below Thread mainThread //... mainThread.Resume(); void StartThread() { while (!wantQuit) { db.runEmail(); mainThread.Suspend(); } } Then i get the exception below be...

Why does SetThreadExecutionState(ES_SYSTEM_REQUIRED) prevent display power-off?

I'm attempting to keep the system on while allowing the display to power off, to allow a download to finish while the system is unattended. To achieve this I call: SetThreadExecutionState(ES_SYSTEM_REQUIRED); whenever I get data from the download. However, this seems to prevent display power down as well (the display dims per its conf...

Delphi thread that waits for data, processes it, then resumes waiting

I need to create a thread in Delphi with the following characteristics: Waits until the main thread adds data to a shared queue. Processes all the data in the queue, returning the results to main thread (for this last part I'll just send messages to the main window). Processing is time-consuming, so new data may be added to the queue w...

How does transaction suspension work in MySQL?

Hi, In the Spring Framework manual they state that for a PROPAGATION_REQUIRES_NEW the current transaction will be suspended. What does that "suspended transaction"? The timer for the timeout stops counting on the current transaction? What are the actual implication of such suspension? Thank you, Asaf ...

SQL Server - Why would my SPID be "SUSPENDED" but not blocked, while creating an index?

I have a SQL 2005 x64 server, and when I attempt to issue some queries against it (for example, when I try to create an index), my SPID goes to "sleeping" immediately, and seems to wait there indefinitely. It's not being blocked (the "BLKBY" column in SP_WHO2 is empty), and the CPU and DiskIO values are very small (under 300 each), and n...

Does CallNtPowerInformation(SystemPowerInfomation...) work on WIndows XP?

I'm trying to access the "TimeRemaining" value for the power management idle counter. Google search indicates that lots of folks (including me) can get a value once, but every subsequent call gives the same results. No countdown, no change in CurIdle value... Here's a short version of the code in question: #include <windows.h> #inclu...