Exemple #1
0
 def quit(self, force=False):
     self.trayIcon.setToolTip('正在退出...')
     self.hide()
     self.trayIcon.hide()
     if force:
         win32process.ExitProcess(0)  # 强制退出,避免退出较慢的问题。
     self.app.exit()
Exemple #2
0
def kill():
    try:
        print "Kill removed reg"
        for thread in TIMER_ARRAY:
            thread.cancel()
        print "Kill timers"
        for thread in THREAD_ARRAY:
            thread.join()
        print "Kill threadss"
    except Exception as e:
        print str(e)
    win32process.ExitProcess(0)
Exemple #3
0
def kill_self():
    try:
        import win32process
        win32process.ExitProcess(0)
    except:
        pass
    try:
        import os, signal
        os.kill(os.getpid(), signal.SIGKILL)
    except:
        pass
    print('Might have to kill this one with Ctrl+C...')
    sys.exit(0)
Exemple #4
0
 def handler(event):
     win32process.ExitProcess(1)
Exemple #5
0
import IPython
import win32console, win32file, win32process

hfile = win32console.GetStdHandle(win32console.STD_OUTPUT_HANDLE)
IPython.embed()
win32file.WriteFile(hfile, "Hello, World!")
win32process.ExitProcess(0)
Exemple #6
0
 def on_expired(self):
     win32process.ExitProcess(0)