功能: QQ自动登录 错误: 密码框输入不了密码, QQ帐号能输入, 什么原因?  QQ的原因, 还是我代码有错?  大虾们请指点小弟
 
 procedure TForm1.Button1Click(Sender: TObject);
var
   h,hu,hp:HWND;
begin
       winexec(pchar('d:\QQ\Bin\qq.exe'),sw_shownormal);
       h:=FindWindow('TXGuiFoundation','QQ2009');
       hu:=FindWindowEx(h,0,'ATL:30A3A470',nil);
       hp:=FindWindowEx(h,0,'Edit',nil);
       SendMessage(hu,WM_SETTEXT,0,Integer(PChar('172704090'))); //Q帐号
       SendMessage(hp,WM_SETTEXT,0,Integer(PChar('123456789'))); //Q密码
       sleep(1000);
       keybd_event(VK_RETURN,0,0,0);
end;
 

解决方案 »

  1.   

    SendMessage(hp,WM_SETTEXT,0,Integer(PChar('123456789'))); //Q密码
    这句要是能发上只能说QQ太垃圾 
      

  2.   

    可是我用vbs能做, delphi能做出来吗? 
      

  3.   

    VBS贴出来看看,按理说是不可能的,难道是传说中的改快捷方式?
      

  4.   


    写得不是很好, 但还是能用dim program 
    program="D:\QQ\Bin\QQ.exe" 
    set Wshell=CreateObject("Wscript.Shell") 
    set oexec=Wshell.Exec(program) 
    wscript.Sleep 2000 
    Wshell.SendKeys "{TAB}"
    Wshell.SendKeys "{TAB}"
    Wshell.SendKeys "{TAB}"
    Wshell.SendKeys "{TAB}"
    Wshell.SendKeys "{TAB}"
    Wshell.SendKeys "{TAB}"
    Wshell.SendKeys "{TAB}"
    Wshell.SendKeys "{TAB}"
    Wshell.SendKeys "888888"
    wscript.Sleep 1000
    Wshell.SendKeys "{TAB}"
    Wshell.SendKeys "xxxxxx"  
    wscript.Sleep 1000
    Wshell.SendKeys "{ENTER}"
    // 888888是帐号, xxxxxx是密码, QQ2009版的, 自己试下