0

I have included <windows.h> in my project. But I seem to be unable to call showWindow and getConsoleWindow anyway.

 #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

Is there something else I should include in my file?

Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778

1 Answers1

4

Try ShowWindow, not showWindow, and GetConsoleWindow, instead..

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

Furthermore, make sure you look at the possible values for nCmdShow, or the second argument

ed_me
  • 3,338
  • 2
  • 24
  • 34