实现对QQ游戏的账号和密码的自动填充,一键登陆功能
1、先给出核心代码:
//一键登陆
void CAutoLoadingQQDlg::OnButtonLoading()
{
// TODO: Add your control notification handler code here
CString parentCaption = "QQ游戏";
CString childCaption = "";
HWND hParent,hChildZhangHao,hChildMiMa;
hParent = ::FindWindow(NULL,parentCaption);
if(NULL != hParent)
{
hChildZhangHao = ::FindWindowEx(hParent,NULL,"Edit",childCaption);
if (NULL != hChildZhangHao) //填账号
{
LPARAM lParamZhang = (LPARAM)"111111111";
::SendMessage(hChildZhangHao,WM_LBUTTONDOWN,0,0);
::SendMessage(hChildZhangHao,WM_LBUTTONUP,0,0);
::SendMessage(hChildZhangHao,WM_SETTEXT,0,lParamZh