flat assembler
Message board for the users of flat assembler.

Index > Windows > Call Program and Wait

Author
Thread Post new topic Reply to topic
Crinan



Joined: 05 Dec 2006
Posts: 28
Location: New Zealand
Crinan 05 Apr 2007, 05:37
Can someone tell me how to call another program and have the calling program wait until the called program terminates?
ShellExecute calls a program but immediately proceeds on its own merry way with gay abandon.
thanks.
Post 05 Apr 2007, 05:37
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 05 Apr 2007, 05:53
Code:
    invoke CreateProcess,0,eax,0,0,1,0,0,0,startup,pi  
    invoke WaitForSingleObject,[pi + PROCESS_INFORMATION.hProcess],-1
    invoke CloseHandle,[pi + PROCESS_INFORMATION.hProcess]
    invoke CloseHandle,[pi + PROCESS_INFORMATION.hThread]    
Post 05 Apr 2007, 05:53
View user's profile Send private message Visit poster's website Reply with quote
Crinan



Joined: 05 Dec 2006
Posts: 28
Location: New Zealand
Crinan 05 Apr 2007, 06:24
Many thanks Shoorick, I'll try that out.
Post 05 Apr 2007, 06:24
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.