ShellExecWait: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
(Created page with '{{PageAuthor|Anders}} Basic code for waiting on a "ExecShell" (Note that you can only wait on programs, not documents or URL's) <highlight-nsis> !include LogicLib.nsh !include …') |
(No difference)
|
Revision as of 18:06, 29 March 2010
| Author: Anders (talk, contrib) |
Basic code for waiting on a "ExecShell" (Note that you can only wait on programs, not documents or URL's)
!include LogicLib.nsh !include WinMessages.nsh #define SEE_MASK_NOCLOSEPROCESS 0x40 System::Call '*(&i60)i.r0' System::Call '*$0(i 60,i 0x40,i $hwndparent,i,t "calc.exe",i ,i,i ${SW_SHOW})i.r0' System::Call 'shell32::ShellExecuteEx(ir0)i.r1 ?e' ${If} $1 <> 0 pop $1 System::Call '*$0(i,i,i,i,i,i,i,i,i,i,i,i,i,i,i.r1)' System::Call 'kernel32::WaitForSingleObject(ir1,i-1)' System::Call 'kernel32::GetExitCodeProcess(ir1s,*i.r1)' System::Call 'kernel32::CloseHandle(is)' ${Else} pop $1 ${EndIf} System::Free $0 MessageBox mb_ok "exitcode or error=$1"