Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

bcome

The console under Win32?

This topic is 5401 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
On NT/XP/2K use GetConsoleHandle to obtain the HWND for the console and then ShowWindow to hide it. However, that won''t prevent the console from popping up when your program launches. Another approach is to use WinMain instead of ''main'', and use freopen to redirect the stdio handles - of course, there''s not much point to stdio if there''s no console to print to or read from. Another approach is to write a WinMain wrapper program that uses CreateProcess to launch the console process without showing it. Adjust the settings of the STARTUPINFO structure appropriately to do that. A web search should turn up information regarding all of these methods. I know the question has been asked on these forums several times before.

Share this post


Link to post
Share on other sites
now I have a problem: I know I am including the "wincon.h" and it defines GetConsoleWindow(), but the compiler is reporting otherwise. Can anyone please tell me what I can do to fix it?

This is what I get:
error C3861: ''GetConsoleWindow'': identifier not found, even with argument-dependent lookup

==============

My Web Page!!!

Share this post


Link to post
Share on other sites
From MSDN: To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0500 or later.

Share this post


Link to post
Share on other sites
I do include windows.h .

EDIT:
quote:
Original post by Martee
From MSDN: To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0500 or later.


You mean to tell me that it is only available on Windows NT?!


==============

My Web Page!!!


[edited by - bcome on September 5, 2003 12:50:17 AM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!