Using Shell Command with Windows NT
Posted on 2002-05-07
I'm using the Shell command in Visual Basic to run an exe:
lRetVal = Shell(exetorun, vbNormalFocus)
I am using the return value (Instance handle) in an if statement:
If lRetVal <> 0 Then
My program contains both 16 bit and 32 bit modules. (ie, exetorun is sometimes a 16bit, sometimes a 32bit)
VB Help states that the Shell Command:
Runs an executable program and returns a Variant (Double) representing the program's task ID if successful, otherwise it returns zero.
The problem is...If my program is being run on Windows NT and Shell is used to run a 16 bit application, the return value is ALWAYS 0! However, it does run the exe.