Question

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?

Était-ce utile?

La solution

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top