[html] view plain copy
 
  1. program Project2;  
  2.   
  3. uses  
  4.   windows,TLHelp32;  
  5.   
  6. function FindProcess(AFileName:string):boolean;   
  7. var   
  8.     hSnapshot:THandle;  
  9.     lppe:TProcessEntry32;   
  10.     Found:Boolean;   
  11. begin   
  12.     Result:=False;  
  13.     hSnapshot:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);   
  14.     lppe.dwSize:=SizeOf(TProcessEntry32);   
  15.     Found:=Process32First(hSnapshot,lppe);   
  16. while Found do  
  17. begin   
  18.     if(lppe.szExeFile = AFileName) then Result:=True;   
  19.     Found:=Process32Next(hSnapshot,lppe);   
  20. end;   
  21. end;  
  22.   
  23. begin  
  24.     if FindProcess('QQ.exe') then  
  25.     MessageBox(0, PChar('QQ存在'), PChar('提示'), MB_OK);  
  26. end.  
 
http://blog.csdn.net/cmdasm/article/details/9961575

相关文章:

  • 2021-08-23
  • 2022-12-23
  • 2021-09-26
  • 2022-02-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-21
  • 2021-08-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案