このサンプルでは、コンソールウィンドウを非表示にします。
#include "windows.h"
#include fstream
#include string
#include stdio.h
using namespace std;
int main()
{
WCHAR path[260];
GetModuleFileName(NULL,path,260);
HWND console = FindWindow(L"ConsoleWindowClass",path);
if(IsWindow(console))
ShowWindow(console,SW_HIDE); // hides the window
//---------------------------------------------------
ifstream readfile("File.txt");
string str;
while(1)
{
getline(readfile,str);
system("cls");
Sleep(10000);
}
//----------------------------------------------------
if(IsWindow(console))
ShowWindow(console,SW_SHOW); // shows the window
}