#coding=utf-8
__author__ = 'Eagle'
import os
import time
import win32gui
import win32api
import win32con
import SendKeys
from ctypes import *
def QQ(qq,pwd):
a = win32gui.FindWindow(None, "QQ")
#运行QQ
os.system('"C:\Program Files (x86)\Tencent\QQ\Bin\QQScLauncher.exe"')
time.sleep(5)
a= win32gui.FindWindow(None,"QQ") # 获取窗口的句柄,参数1: 类名,参数2: 标题QQ
loginid= win32gui.GetWindowPlacement(a)
windll.user32.SetCursorPos(loginid[4][0]+300, loginid[4][1]+273 )
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,0,0,0,0) #按下鼠标
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,0,0,0,0) #放开鼠标
time.sleep(0.2)
###输入账号
SendKeys.SendKeys(qq)
time.sleep(0.2)
##tab切换
win32api