terminate

When is a C++ terminate handler the Right Thing(TM)?

淺唱寂寞╮ 提交于 2019-12-30 08:08:09
问题 The C++ standard provides the std::set_terminate function which lets you specify what function std::terminate should actually call. std::terminate should only get called in dire circumstances, and sure enough the situations the standard describes for when it's called are dire (e.g. an uncaught exception). When std::terminate does get called the situation seems analagous to being out of memory -- there's not really much you can sensibly do. I've read that it can be used to make sure resources

run xterm -e without terminating

耗尽温柔 提交于 2019-12-30 08:00:48
问题 I want to run xterm -e file.sh without terminating. In the file, I'm sending commands to the background and when the script is done, they are still not finished. What I'm doing currently is: (cd /myfolder; /xterm -ls -geometry 115x65 -sb -sl 1000) and then after the window pops up sh file.sh exit What I want to do is something like: (cd /myfolder; /xterm -ls -geometry 115x65 -sb -sl 1000 -e sh file.sh) without terminating and wait until the commands in the background finish. Anyone know how

SBT stop run without exiting

泪湿孤枕 提交于 2019-12-28 02:28:06
问题 How do you terminate a run in SBT without exiting? I'm trying CTRL+C but it exits SBT. Is there a way to only exit the running application while keeping SBT open? 回答1: In the default configuration, your runs happen in the same JVM that sbt is running, so you can't easily kill them separately. If you do your run in a separate, forked JVM, as described at Forking, then you can kill that JVM (by any means your operating system offers) without affecting sbt's JVM: fork in run := true 回答2: From

Hooking TerminateProcess & Getting Info From The Handle It Supplies

允我心安 提交于 2019-12-25 16:00:34
问题 If you want to stop a process from being terminated, one way is to hook into TerminateProcess (or NtTerminateProcess). If the process is terminating itself (because you closed its window, for example), the handle supplied to those functions is NULL, so you can find out what executable is being terminated using GetCurrentProcess() & GetModuleFileNameEx(). As GetCurrentProcess() returns a pseudo-handle, you can access it with no problems. If one process is terminating another, though, the

Close Image with subprocess

我怕爱的太早我们不能终老 提交于 2019-12-25 08:49:24
问题 I am trying to open an image with subprocess so it is visible to the user, then close the image so that it disapears. This question has been asked before, but the answers I found have not worked for me. Here is what I have checked: Killing a process created with Python's subprocess.Popen() How to terminate a python subprocess launched with shell=True How can I close an image shown to the user with the Python Imaging Library? I need the code to open an image (with Preview (optional), default

Terminate all child process in LInux

夙愿已清 提交于 2019-12-25 07:09:38
问题 I am developing a sandbox on linux. And now i am confused terminating all process in the sandbox. My sandbox works as follows: At first only one process run in the sandbox. Then it can create several child process. And child process will create their subprocess also. And parent process may exit at some time before its children exited. At last sandbox will terminate all the process. I used to do this by using killall or pkill -u with a unique user attached to the sandbox.But it seems doesn't

Windows 8 Metro/Immersive App - Force Terminate

偶尔善良 提交于 2019-12-25 06:18:08
问题 I'm working on porting an app from iOS to WinRT/8 Metro/8 Immersive/Whatever the current name is. On iOS, we have the ability to set Application does not run in background to YES to cause the app to actually quit whenever the user leaves the app. I would like to figure out how to replicate this behavior in WinRT. Yes, I understand that this is abnormal behavior. Yes, I have thought this through. Yes, I have an extremely good reason for doing this. I'm assuming that during the userLeavingApp

Windows 8 Metro/Immersive App - Force Terminate

偶尔善良 提交于 2019-12-25 06:18:03
问题 I'm working on porting an app from iOS to WinRT/8 Metro/8 Immersive/Whatever the current name is. On iOS, we have the ability to set Application does not run in background to YES to cause the app to actually quit whenever the user leaves the app. I would like to figure out how to replicate this behavior in WinRT. Yes, I understand that this is abnormal behavior. Yes, I have thought this through. Yes, I have an extremely good reason for doing this. I'm assuming that during the userLeavingApp

How to terminate a process if it has specific folder name in its path?

廉价感情. 提交于 2019-12-25 00:20:51
问题 I run an application from PowerBuilder and terminate it when i dont need it. But the application when running, it executes other processes from a specific folder. I want to kill all processes if they run from a specific folder. How to get the process handles of all those processes that have specif folder name in their path? 回答1: Here an example to show how to terminate all running instance of Notepad.exe OleObject wsh integer li_rc wsh = CREATE OleObject wsh.ConnectToNewObject(

How can I retrieve current terminate() handler without changing it?

夙愿已清 提交于 2019-12-24 18:18:13
问题 Here's the problem. My application calls CoCreateInstance() to create a COM object implemented in a third-party DLL. That DLL calls set_terminate() to change the terminate() handler and passes an address of its own terminate() handler there. The initial terminate() handler address is not saved by that library - it doesn't care and simply changes the handler and never restores it. As soon as the DLL gets unloaded its code is no longer in the process memory, so if now terminate() is called the