//#include "stdafx.h"
#define _WIN32_WINNT 0x0500
#include <Windows.h>
#include <stdio.h>
#include <windows.h>
extern "C" WINBASEAPI HWND WINAPI GetConsoleWindow ();
void main()
{
DeleteMenu(GetSystemMenu(GetConsoleWindow(), FALSE), SC_CLOSE, MF_BYCOMMAND);
DrawMenuBar(GetConsoleWindow());
printf("Now you cannot close this window...\n");
system("pause");
}