summaryrefslogtreecommitdiffstats
path: root/chrome_frame/tools/helper_shutdown.py
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-04 22:41:56 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-04 22:41:56 +0000
commite333e8d07ee32668fc132a21c13cdf674443d1e9 (patch)
tree6939c1e82d17ce20c305a09c5b17d56e21fe84d9 /chrome_frame/tools/helper_shutdown.py
parenta0098dcc4beda20fea045352fde3e4725cd18a9b (diff)
downloadchromium_src-e333e8d07ee32668fc132a21c13cdf674443d1e9.zip
chromium_src-e333e8d07ee32668fc132a21c13cdf674443d1e9.tar.gz
chromium_src-e333e8d07ee32668fc132a21c13cdf674443d1e9.tar.bz2
Add a tiny helper script to shutdown the chrome frame helper process.
BUG=53127 TEST=Run script, chrome_frame_helper.exe is shut down. Review URL: http://codereview.chromium.org/3312010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58587 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/tools/helper_shutdown.py')
-rw-r--r--chrome_frame/tools/helper_shutdown.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/chrome_frame/tools/helper_shutdown.py b/chrome_frame/tools/helper_shutdown.py
new file mode 100644
index 0000000..770adda
--- /dev/null
+++ b/chrome_frame/tools/helper_shutdown.py
@@ -0,0 +1,30 @@
+# Copyright (c) 2010 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+'''This is a simple helper script to shut down the Chrome Frame helper process.
+It needs the Python Win32 extensions.'''
+
+import pywintypes
+import sys
+import win32gui
+import win32con
+
+def main():
+ exit_code = 0
+ window = win32gui.FindWindow('ChromeFrameHelperWindowClass',
+ 'ChromeFrameHelperWindowName')
+ if not window:
+ print 'Chrome Frame helper process not running.'
+ else:
+ try:
+ win32gui.PostMessage(window, win32con.WM_CLOSE, 0, 0)
+ print 'Chrome Frame helper process shut down.'
+ except pywintypes.error as ex:
+ print 'Failed to shutdown Chrome Frame helper process: '
+ print ex
+ exit_code = 1
+
+ return exit_code
+
+if __name__ == '__main__':
+ sys.exit(main())