I've often usd the Shell command and 'waited' for it to finish using this technique:-
...but now I want to do something similar except I want to use the default program to open a file.Waiting For Shell Code:
Let lngPID = Shell(strExecutable, vbNormalFocus) Let lngPID = OpenProcess(SYNCHRONIZE, False, lngPID) Do Let lngReturn = WaitForSingleObject(lngPID, 0) DoEvents Loop While lngReturn <> 0
Shell execute will use the default program for me:-
...but it doesn't return a program or process ID I can use with the WaitForSingleObject call.Shell Execute Code:
Call ShellExecute(hWnd, "open", mstrImagePath, "", "", 10)
Is there any way I can wait for ShellExecute?




Reply With Quote