- Aug
- 2,033
- 82
I am using;
When I run this code from CMD.EXE, the program returns;
When I run it from TCC, either in TCMD, or in a detached TCC session, it returns;
Why does this work properly in CMD.EXE, but not in TCC.EXE?
Joe
Code:
TCC 17.00.67 Windows Vista [Version 6.0.6002]
TCC Build 67 Windows Vista Build 6002 Service Pack 2
When I run this code from CMD.EXE, the program returns;
Code:
Started from command prompt
When I run it from TCC, either in TCMD, or in a detached TCC session, it returns;
Code:
NOT started from command prompt
Code:
#COMPILE EXE
#INCLUDE "win32api.inc"
FUNCTION StartedFromConsole() AS LONG
LOCAL lpStartupInfo AS STARTUPINFO
lpStartupInfo.cb = SIZEOF(STARTUPINFO): GetStartupInfo lpStartupInfo
IF lpStartupInfo.dwXSize <> 0 OR lpStartupInfo.dwYSize <> 0 THEN FUNCTION = %TRUE
END FUNCTION
FUNCTION PBMAIN () AS LONG
IF StartedFromConsole = %TRUE THEN
? "Started from command prompt"
ELSE
? "NOT started from command prompt"
SLEEP 2000 '// add a delay here to give the user time to read the console before it ends
END IF
END FUNCTION
Why does this work properly in CMD.EXE, but not in TCC.EXE?
Joe