How to hide the console window of a C program?

后端 未结 1 1960
温柔的废话
温柔的废话 2020-12-09 09:48

I\'ve been looking around but I couldn\'t find the solution to my problem, even with some supposedly solved problems that resemble mine.

I want to hide the console w

相关标签:
1条回答
  • 2020-12-09 10:30

    Your

    #define _WIN32_WINNT 0x0500
    

    (which is needed to use GetConsoleWindow - see the documentation) must be before

    #include <windows.h>
    

    That #define is used by windows.h to know which version of Windows you are targeting (and thus which declarations it has to provide/which additional fields it has to add to structures/other magic that may be related to that linker error); if you define it after you include windows.h it will be useless.

    0 讨论(0)
提交回复
热议问题