Add installation warning message for networkingPrivate api
[chromium-blink-merge.git] / chrome_frame / tools / helper_shutdown.py
bloba8188087f73f0ac7921b7639da332fce51381895
1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5 """This is a simple helper script to shut down the Chrome Frame helper process.
7 Requires Python Win32 extensions.
8 """
10 import pywintypes
11 import sys
12 import win32gui
13 import win32con
16 def main():
17 exit_code = 0
18 window = win32gui.FindWindow('ChromeFrameHelperWindowClass',
19 'ChromeFrameHelperWindowName')
20 if not window:
21 print 'Chrome Frame helper process not running.'
22 else:
23 try:
24 win32gui.PostMessage(window, win32con.WM_CLOSE, 0, 0)
25 print 'Chrome Frame helper process shut down.'
26 except pywintypes.error as ex:
27 print 'Failed to shutdown Chrome Frame helper process: '
28 print ex
29 exit_code = 1
30 return exit_code
33 if __name__ == '__main__':
34 sys.exit(main())