Created
July 19, 2014 08:09
-
-
Save ariscop/6dc05549de0c7ec3e110 to your computer and use it in GitHub Desktop.
Function to check if a program was launched from cmd/powershell/so on
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Detect if we're launched outside of cmd by checking for other processes on our console */ | |
BOOL isTerminal(void) { | |
DWORD pid; | |
return GetConsoleProcessList(&pid, 1) != 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment