OPTIONS "WINFUNC NOSOURCE C_CALL"
NUMERIC DIGITS 10
DO
FUNCDEF('ShellExecute', 'void, void, str, str, str, str, 32u', 'shell32')
CATCH FAILURE
CONDITION("M")
RETURN
END
SAY "This is the parent script, launching the child script."
result = shellexecute(, , 'child.rex', , , 1)
IF result <= 32 THEN DO
SELECT
WHEN result = 0 | result = 8 THEN SAY "The operating system is out of memory or resources."
WHEN result = 2 THEN SAY "The specified file was not found."
WHEN result = 3 THEN SAY "The specified path was not found."
WHEN result = 5 THEN SAY "The operating system denied access to the specified file."
WHEN result = 11 THEN SAY "The .EXE file is invalid (non-Win32 .EXE or error in .EXE image)."
WHEN result = 26 THEN SAY "A sharing violation occurred."
WHEN result = 27 THEN SAY "The filename association is incomplete or invalid."
WHEN result = 28 THEN SAY "The DDE transaction could not be completed because the request timed out."
WHEN result = 29 THEN SAY "The DDE transaction failed."
WHEN result = 30 THEN SAY "The DDE transaction could not be completed because other DDE transactions were being processed."
WHEN result = 31 THEN SAY "There is no application associated with the given filename extension."
WHEN result = 32 THEN SAY "The specified dynamic-link library was not found."
OTHERWISE SAY "ShellExecute failed."
END
EXIT
END
SAY "Press any key to end the parent..."
PULL
RETURN |