监测内存里有没有你程序。
具体方法可以用CSDN的搜索一下,这个问题问过好多次了

解决方案 »

  1.   

    提供一个思路:
    枚举系统中所有的进程,判断它的可执行文件的名字是不是那个程序的就行了!
    uses tlhelp32;var
    lppe:tprocessentry32;
    sshandle:thandle;
    found:boolean;
    begin
    sshandle:=createtoolhelp32snapshot(th32cs_snapail,0);
    found:=process32first(sshandle,lppe);
    while found do
    begin
    //进行你的处理其中lppe.szExefile就是程序名。
    if uppercase(extractfilename(lppe.szexefile))=uppercase('abcd.exe') then 
    showmessage('Already Run!');
    found:=proccess32next(sshandle,lppe);
    end;
    end;
     
      

  2.   

    http://www.csdn.net/expert/topic/512/512507.shtm
      

  3.   

    使用TApplication构件的事件就可以了,可以检测出程序是否是激活状态
      

  4.   

    使用TApplicationEvents构件的OnActive事件
      

  5.   

    http://www.csdn.net/expert/TopicView.asp?id=512806
    救命啊
      

  6.   

    用API:
    if GetForegroundWindow = Handle then 你的窗口被激活 else 你的窗口不被激活
      

  7.   

    jarjarbink(答案丢了) 
    上述语句放在哪,用TTimer吗?