Close All Browser In Nsis

本小妞迷上赌 提交于 2019-12-11 12:42:07

问题


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

this is not working .

Giving me some error.

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


回答1:


I got Answer

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

we can kill any task.



来源:https://stackoverflow.com/questions/18397913/close-all-browser-in-nsis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!