Talk:Execute a system command: Difference between revisions

→‎Visual Basic - does it suck as much as this implies?: WaitForSingleObject, other kernel DLL exports, and VB6.
(→‎Visual Basic - does it suck as much as this implies?: WaitForSingleObject, other kernel DLL exports, and VB6.)
Line 14:
 
[[User:Rosuav|Rosuav]] 12:26, 11 January 2010 (UTC)
: You certainly can use the WaitFor* functions (and any of the other NT-supported synchronization objects) and wait on the handle returned by CreateProcess. The reason is that CreateProcess and WaitFor functions are exported by NT's kernel DLL; You can get access to them the same way you can access any other DLL export. The code for showing how to do that ''should'' be shown as part of a VB example to [[Call foreign language function]], but it hasn't been added yet. A walkthrough can be found in [http://support.microsoft.com/kb/106553 KB106553].
 
: It's worth noting, though, that if you block your VB6 thread with WFSO, you're blocking your message processing thread, and Windows will notice your process has stopped responding (until the child process terminates). The normal resolution would likely be to have a timer trigger a WFSO(hHandle,0) at a reasonable interval. (This assumes that threaded concurrency isn't possible within VB6. If it is, I don't know how.) --[[User:Short Circuit|Michael Mol]] 14:45, 11 January 2010 (UTC)