'showWindow':包含<windows.h> </windows.h>的标识符

时间:2013-02-23 12:56:03

标签: c++ winapi showwindow

我在项目中加入了<windows.h>。但无论如何,我似乎无法拨打showWindowgetConsoleWindow

 #ifdef _WIN32
   #include <windows.h>
   bool consoleButtonCallback(void* but);
 #endif
 /*tons of code here*/
   /* ... */
#ifdef _WIN32
   bool consoleButtonCallback(void* but) 
   {
       Opencv_Button* button = (Opencv_Button*)but;
       bool visible = false;
       if(button->click%2!=0) 
       {
           button->val("Hide console");
           showWindow(getConsoleWindow(), 1);   //'showWindow': identifier not found

       }
       else
       {
           button->val("Show console");
           showWindow(getConsoleWindow(), 0);   //'showWindow': identifier not found
       }
       return true;
   }
#endif

我的文件中还有其他内容吗?

1 个答案:

答案 0 :(得分:4)

尝试使用ShowWindow,而不是showWindow和GetConsoleWindow,而不是..

Win32 API: -

http://msdn.microsoft.com/en-gb/library/windows/desktop/ms633548%28v=vs.85%29.aspx http://msdn.microsoft.com/en-gb/library/windows/desktop/ms683175%28v=vs.85%29.aspx

此外,请确保查看nCmdShow或第二个参数

的可能值