'showWindow':未找到标识符包含
问题描述:
我在项目中包含<windows.h>
。但我似乎无论如何都无法拨打showWindow
和getConsoleWindow
。'showWindow':未找到标识符<windows.h>包含
#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
还有什么我应该包括在我的文件?
答
尝试的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的可能值,或第二个参数