GetConsoleWindow was not declared in this scope


有时使用GetConsoleWindow()找控制台窗口的句柄时,会提示出错信息:

'GetConsoleWindow' was not declared in this scope.


解决的方法有:

要么在文件头写上:#define _WIN32_WINNT 0x0500

要么在文件头写上:wincon.h

要么在文件头写上:extern "C" WINBASEAPI HWND WINAPI GetConsoleWindow ();


你可能感兴趣的:(GetConsoleWindow was not declared in this scope)