On Sun, 21 Apr 2013 15:21:02 +0800, "Bruce Varley" <bv@NoSpam.com>
>Need to get the window handle for a Win32 console app. According to a few
>websites, the following should work:
>HWND hConsole ;
> hConsole = GetConsoleWindow() ;
>But the compile reports an error:
>error C2065: 'GetConsoleWindow' : undeclared identifier
>The project link settings do include kernel32.lib, as instructed.
>Any assistance much appreciated.
This is a compiler error, not a linker error, so don't fret about the
libs just yet, you haven't gotten that far.
You can use the Visual Studio IDE to jump to the definition of these
constants or you can add this to your source to verify David's
#error _WIN32_WINNT not defined
#error _WIN32 not defined
#error _CONSOLE not defined
These will stop compiliation if your project is incorrectly targeted.