简体   繁体   中英

AttachConsole(…) alternative for Windows8

AttachConsole(ATTACH_PARENT_PROCESS) returns TRUE and GetLastError() returns ERROR_NOT_SUPPORTED when running console (ie parent process is cmd.exe) application on Windows8. Is there any alternative which can be used with this OS?

The value of GetLastError is random if AttachConsole returns true (ie, successful calls to AttachConsole or indeed any Win32 API function won't reset the last error code). Only check for the error code if it was set.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM