Advertisement
Guest User

888_popup_autocloser

a guest
Apr 28th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. import pywinauto
  2. from time import sleep
  3.  
  4. pwa_app = pywinauto.application.Application()
  5. titles = [
  6.     {'best_match': u'Tournament ID: '},
  7.     {'title': u'Member Message'},
  8.     {'title': u'User Message'},
  9.     {'best_match': u'Tournament Registration: '},
  10. ]
  11.  
  12. if __name__ == "__main__":
  13.     print "Auto closer popup. running..."
  14.     while True:
  15.         for title in titles:
  16.             params = {'class_name': '#32770'}
  17.             params.update(title)
  18.             try:
  19.                 w_handle = pywinauto.findwindows.find_windows(**params)[0]
  20.                 window = pwa_app.window_(handle=w_handle)
  21.                 window.TypeKeys("\n", with_newlines = True)
  22.             except IndexError:
  23.                 pass
  24.         sleep(0.05)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement