如何检测excel是否运行?如果已经运行,如何知道excel在任务栏是否可见?

解决方案 »

  1.   

    给分吧!
    var h:hwnd;
    begin
    h:=findwindow('XLMAIN',nil);
    if h<>0 then
    begin
      if IsWindowVisible(h) then//如果在任务栏可见
     showmessage('EXCEL正在运行!');
    end;
    end;
      

  2.   

    var h:hwnd;
    begin
    h:=findwindow('excel.exe',nil);
    if h<>0 then
    begin
      if IsWindowVisible(h) then//如果在任务栏可见
     showmessage('EXCEL正在运行!');
    end;
    end;
      

  3.   

    感谢 l0f(凌风)和 WWWWA(aaaa),给分了.