关闭Nsis中的所有浏览器 [英] Close All Browser In Nsis

查看:913
本文介绍了关闭Nsis中的所有浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

制作一个将关闭所有在nsis中打开的浏览器的代码。

Making A Code Which Will Close All opened Browser in nsis.

var hadBrowsers
Function closeAllBrowsers
FindWindow $0 "IEFrame"
IntCmp $0 0 0 closeAll
FindWindow $0 "MozillaUIWindowClass"
IntCmp $0 0 0 closeAll
FindWindow $0 "Chrome_WidgetWin_0"
IntCmp $0 0 done closeAll
closeAll:
MessageBox MB_OK "Please close your browsers or press ok to close them all automatically"
;Closing all IE Windows
loop:
   FindWindow $0 "IEFrame"
   IntCmp $0 0 skipIE
   IsWindow $0 0 skipIE
   System::Call 'user32::PostMessageA(i,i,i,i) i($0,${WM_CLOSE},0,0)'
   StrCpy $hadBrowsers "1"
   skipIE:
   FindWindow $0 "MozillaUIWindowClass"
   IntCmp $0 0 skipFF
   IsWindow $0 0 skipFF
   System::Call 'user32::PostMessageA(i,i,i,i) i($0,${WM_CLOSE},0,0)'
   StrCpy $hadBrowsers "1"
   skipFF:
   FindWindow $0 "Chrome_WidgetWin_0"
   IntCmp $0 0 skipGC
   IsWindow $0 0 skipGC
   System::Call 'user32::PostMessageA(i,i,i,i) i($0,${WM_CLOSE},0,0)'
   StrCpy $hadBrowsers "1"        
   skipGC:
   FindWindow $0 "IEFrame"
   IntCmp $0 0 0 wait
   FindWindow $0 "MozillaUIWindowClass"
   IntCmp $0 0 0 wait
   FindWindow $0 "Chrome_WidgetWin_0"
   IntCmp $0 0 done wait
 wait:
   Sleep 100
   goto loop
 done:
 ;MessageBox MB_OK $hadBrowsers
 StrCmp $hadBrowsers "1" 0 +1        
    Sleep 2000
FunctionEnd

这不工作。

给我一​​些错误。

我试图在nsis中创建一个代码,它将关闭所有打开的浏览器并重新打开它们。

I am trying to make a code in nsis which will close all opened browser and reopen them.

推荐答案

Section 
Execwait '"$SYSDIR\taskkill.exe" /F /IM chrome.exe /T'
SectionEnd

我们可以杀死任何任务。

we can kill any task.

这篇关于关闭Nsis中的所有浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆