So, I found alone the solution.
In a console C++/CLI application, create a small Utilities class :
Utilities.h :
public ref class Utilities abstract sealed {
public:
static void showConsole(
bool show );
};
Utilities.cpp :
//-------------------------------------
/** Utilities.cpp
*/
#include "stdafx.h"
#include "Utilities.h"
#include <windows.h>
void Utilities::showConsole(
bool show ) {
HWND hWnd = GetConsoleWindow();
if (hWnd != 0) {
ShowWindow( hWnd, show ? SW_SHOW : SW_HIDE);
}
}
And don't forget to check in link option "Other dependencies" "herit of default parameter of parent project" (and then suppress keyword $(NOINHERIT), in order to access to windows API of ShowWindow.
It works perfectly.