def main(): import time t = SystrayIconThread() t.start() time.sleep(2) t.post_message(WM_APP, 1, 2) time.sleep(1) print 'Sending quit' t.quit()