我想使用FindWindowByWindowName()方法来判断是否有卸载程序在运行 但是总是返回Flase
任务栏的名称叫做  卸载
提示框的标题 叫做: 自检工具 卸载
我该怎么办啊  加班中 5555555555555

解决方案 »

  1.   

    可以试试uninstallsilent这个函数,帮助上介绍:return true if uninstall is running silently,false otherwise.
      

  2.   

    function IsModuleLoaded(modulename: String ): Boolean;
    external 'IsModuleLoaded@files:psvince.dll stdcall';
    function InitializeSetup(): boolean;
    var
    IsAppRunning: boolean;
    begin
    Result:= true;
    IsAppRunning:= IsModuleLoaded('Compil32.exe'); //程序文件名
    while IsAppRunning do
    begin
    if MsgBox('INNO SETUP正在运行,继续安装前请先关闭它!'#13'[建议先卸载]要继续安装吗?' #13#13 ' WWW.DREAMS8.COM', mbConfirmation, MB_OKCANCEL) = IDOK then
    IsAppRunning:= IsModuleLoaded('Compil32.exe') //程序文件名
    else
    begin
    IsAppRunning:= false;
    Result:= false;
    end;
    end;
    end;[/code] 
      

  3.   

    INNO setup安装卸载钱判断进程中是否在运行总结2011-03-19 10:31:15|  分类: inno安装包相关 |  标签:dll  进程  运行  判断  安装   |字号大

    小 订阅 
    1.安装前判断进程中是否有程序在运行。[files]; 安装前判断进程,dll文件放在inno的安装目录中
    Source: compiler:psvince.dll; Flags: dontcopy noencryption[Code]
    //安装前判断是否有进程正在运行
    function IsModuleLoaded(modulename: String ): Boolean;
    external 'IsModuleLoaded@files:psvince.dll stdcall setuponly';
    function InitializeSetup(): boolean;
    var
    IsAppRunning: boolean;
    begin
    Result:= true;
    IsAppRunning:= IsModuleLoaded('WordTutor.exe');
    while IsAppRunning do
    begin
    if MsgBox('快乐背单词正在运行,请先关闭它!', mbConfirmation, MB_OKCANCEL) = IDOK then
    IsAppRunning:= IsModuleLoaded('WordTutor.exe')
    else
    begin
    IsAppRunning:= false;
    Result:= false;
    end;
    end;
    end;
      

  4.   

    回复 1 楼 :
    我是要在卸载时判断有没有其他卸载程序在运行,而函数uninstallsilent 将会判断自身是否在运行,
    1楼 帮帮吗吧再
      

  5.   

    请问楼主为什么要判断其它程序是否在卸载? 是否知道该程序的Mutex, 知道的话可以在Innosetup里试试checkmutex。