打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
检查某个exe文件是否正在运行

检查某个exe文件是否正在运行

Posted on 2007-08-15 11:05 OldHawk 阅读(379) 评论(0) 编辑 收藏
function exe_is_running(const exeName:String) : Boolean;  //exeName:不要扩展名的Exe主文件名   
var  
  hCurrentWindow:HWnd;   
  szText:array[
0..254] of char;   
begin  
  Result :
= False;   
  hCurrentWindow:
=Getwindow(Application.Handle,GW_HWNDFIRST);   
  
while hCurrentWindow <> 0 do  
  begin  
    
if Getwindowtext(hCurrentWindow,@sztext,255)>0 then  
    begin  
       
if LowerCase(pchar(@sztext))=LowerCase(exeName) then  
       begin  
         Result :
= true;   
         Exit;   
       end;   
    end;   
    hCurrentWindow:
=Getwindow(hCurrentwindow,GW_HWndNext);   
  end;   
end;   

用法:
如我们要判断'Live.exe'程序是否正在运行/是否已经启动
if exe_is_running(Live) then
  ....
else

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
2014高考英语复习:高考作文经典100句(9)
We R Who We R live
because you live
I live you!
音乐让我们变可爱
口语天天练 | I can live with that.
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服