当前位置: 首页>>代码示例>>C++>>正文


C++ SetConsoleTitle函数代码示例

本文整理汇总了C++中SetConsoleTitle函数的典型用法代码示例。如果您正苦于以下问题:C++ SetConsoleTitle函数的具体用法?C++ SetConsoleTitle怎么用?C++ SetConsoleTitle使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SetConsoleTitle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DevConsoleCreate

void DevConsoleCreate(){

	CONSOLE_SCREEN_BUFFER_INFO consoleInfo;
	int consoleHandleR, consoleHandleW;
	long stdioHandle;
	FILE *fptr;

	AllocConsole();
	std::wstring strW = L"Dev Console";
	SetConsoleTitle(strW.c_str());

	EnableMenuItem(GetSystemMenu(GetConsoleWindow(), FALSE), SC_CLOSE, MF_GRAYED);
	DrawMenuBar(GetConsoleWindow());

	GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &consoleInfo);
	
	freopen("conin$", "r", stdin);
	freopen("conout$", "w", stdout);
	freopen("conout$", "w", stderr);


}
开发者ID:skatpgusskat,项目名称:TangoMike,代码行数:22,代码来源:TangoMike.cpp

示例2: ardrone_tool_init_custom

/*--------------------------------------------------------------------
The delegate object calls this method during initialization of an 
ARDrone application 
--------------------------------------------------------------------*/
C_RESULT ardrone_tool_init_custom(int argc, char **argv)
{
	/* Change the console title */
		vp_os_mutex_init(&consoleMutex);
		system("cls");
		SetConsoleTitle(TEXT("Parrot A.R. Drone SDK Demo for Windows"));
		//CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)&HmiStart,NULL,0,0);
		//CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)&HmiStart2,NULL,0,0);


	/* Registering for a new device of game controller */
		ardrone_tool_input_add( &dx_keyboard );
		ardrone_tool_input_add( &dx_gamepad );
	
	/* Start all threads of your application */
		START_THREAD( directx_renderer_thread , NULL);
		START_THREAD( video_stage, NULL );

		
  
  return C_OK;
}
开发者ID:show0k,项目名称:uvhar,代码行数:26,代码来源:custom_code.c

示例3: GetConsoleWindow

xlwLogger::xlwLogger(){
    theConsoleHandel= GetConsoleWindow();
    if(theConsoleHandel)FreeConsole();

    BOOL flag = AllocConsole();
    theConsoleHandel= GetConsoleWindow();
    theScreenHandel = GetStdHandle(STD_OUTPUT_HANDLE);
    wchar_t titlePtr[]=L" xlwLogger Window \0";
    
    SetConsoleTitle(LPCWSTR(titlePtr));

    time(&theTime[0]);
    theInnerStream << " xlwLogger Initiated    " 
                   << ctime(&theTime[0])
                   << " \n Code Compiled " 
                   << __TIME__  << "  "
                   << __DATE__;
    Display();
    
    theTimeIndex=0;
    
}
开发者ID:Laeeth,项目名称:d_excelsdk,代码行数:22,代码来源:xlwLogger.cpp

示例4: wmain

int wmain(int argc, wchar_t * argv[])
{
	int i, status = STATUS_SUCCESS;
#ifndef _WINDLL
	wchar_t input[0xff];
	_setmode(_fileno(stdout), _O_U8TEXT);
	_setmode(_fileno(stderr), _O_U8TEXT);
	SetConsoleOutputCP(CP_UTF8);
	SetConsoleTitle(MIMIKATZ L" " MIMIKATZ_VERSION L" " MIMIKATZ_ARCH);
	SetConsoleCtrlHandler(HandlerRoutine, TRUE);
#endif
	kprintf(L"\n"
		L"  .#####.   " MIMIKATZ_FULL L"\n"
		L" .## ^ ##.  \n"
		L" ## / \\ ##  /* * *\n"
		L" ## \\ / ##   Benjamin DELPY `gentilkiwi` ( [email protected] )\n"
		L" '## v ##'   http://blog.gentilkiwi.com/mimikatz             (oe.eo)\n"
		L"  '#####'                                    with %3u modules * * */\n\n", sizeof(mimikatz_modules) / sizeof(KUHL_M *));
	
	mimikatz_initOrClean(TRUE);
	for(i = MIMIKATZ_AUTO_COMMAND_START ; (i < argc) && (status != STATUS_FATAL_APP_EXIT) ; i++)
	{
		kprintf(L"\n" MIMIKATZ L"(" MIMIKATZ_AUTO_COMMAND_STRING L") # %s\n", argv[i]);
		status = mimikatz_dispatchCommand(argv[i]);
	}
#ifndef _WINDLL
	while (status != STATUS_FATAL_APP_EXIT)
	{
		kprintf(L"\n" MIMIKATZ L" # "); fflush(stdin);
		if(wscanf_s(L"%[^\n]s", input, sizeof(input)) == 1)
		{
			kprintf_inputline(L"%s\n", input);
			status = mimikatz_dispatchCommand(input);
		}
	}
#endif
	mimikatz_initOrClean(FALSE);
	return STATUS_SUCCESS;
}
开发者ID:HelloISME,项目名称:mimikatz,代码行数:39,代码来源:mimikatz.c

示例5: main

int main()
{
	SetConsoleTitle("Login server for Knight Online v" STRINGIFY(__VERSION));

	// Override the console handle
	SetConsoleCtrlHandler(_ConsoleHandler, TRUE);

	// Startup server
	if (!g_pMain.Startup())
	{
		system("pause"); // most users won't be running this via command prompt
		return 1;
	}

	printf("\nServer started up successfully!\n");

	// Create handle, wait until console's signaled as closing
	s_hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
	WaitForSingleObject(s_hEvent, INFINITE);

	return 0;
}
开发者ID:BrokenWings,项目名称:snoxd-koserver,代码行数:22,代码来源:main.cpp

示例6: main

int main()
{
  CXBOXController controller(1);
  Gopher gopher(&controller);
  HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
  SetConsoleTitle( TEXT( "Gopher360" ) );

  system("Color 1D");

  printf("Welcome to Gopher360 - a VERY fast and lightweight controller-to-keyboard & mouse input tool.\n");
  printf("All you need is an Xbox360/Xbone controller (wired or wireless adapter), or DualShock (with InputMapper 1.5+)\n");
  printf("Gopher will autofind the xinput device and begin reading input - if nothing happens, verify connectivity.\n");
  printf("See the GitHub repository at bit.ly/1syAhMT for more info. Twitter contact: TylerAt60FPS\n\n-------------------------\n\n");
  
  SetConsoleTextAttribute(hConsole, 23);
  printf("Gopher is free (as in freedom) software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n");
  printf("\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see http://www.gnu.org/licenses/.");
  SetConsoleTextAttribute(hConsole, 29);
  printf("\n\n-------------------------\n\n");

  SetConsoleTextAttribute(hConsole, 5); // set color to purple on black (windows only)
  // 29 default

  // dump important tips
  printf("Tip - Press left and right bumpers simultaneously to toggle speeds! (Default is left and right bumpers, configurable in config.ini)\n");

  if (!isRunningAsAdministrator())
  {
    printf("Tip - Not running as an admin! Windows on-screen keyboard and others won't work without admin rights.\n");
  }

  gopher.loadConfigFile();

  // Start the Gopher program loop
  while (true)
  {
    gopher.loop();
  }
}
开发者ID:Tylemagne,项目名称:Gopher360,代码行数:39,代码来源:main.cpp

示例7: LoadGTALuaIni

// =================================================================================
// Init
// Called right after the CTor
// =================================================================================
void GTALua::Init()
{
	// Main Config
	LoadGTALuaIni();

	// Attach Console
#ifndef GTA_LUA_TEST_EXE
	if (m_sConfig.bConsole_Enabled)
	{
		UTIL::Attach_Console(m_sConfig.bConsole_AutomaticPosition, m_sConfig.iConsole_ManualX, m_sConfig.iConsole_ManualY);
		SetConsoleTitle("GTALua - Version 1.1.2");
	}
#endif

	// Prepare Memory
	Memory::Init();
	GameMemory::Init();

	// Configuration Files
	LoadNativesINI();
	LoadCallLayoutsINI();
}
开发者ID:leonardosnt,项目名称:GTALua,代码行数:26,代码来源:Main.cpp

示例8: CON_Init

/*
==================
CON_Init
==================
 */
void CON_Init(void) {
    CONSOLE_CURSOR_INFO curs;
    CONSOLE_SCREEN_BUFFER_INFO info;
    int i;

    // handle Ctrl-C or other console termination
    SetConsoleCtrlHandler(CON_CtrlHandler, TRUE);

    qconsole_hin = GetStdHandle(STD_INPUT_HANDLE);
    if (qconsole_hin == INVALID_HANDLE_VALUE)
        return;

    qconsole_hout = GetStdHandle(STD_OUTPUT_HANDLE);
    if (qconsole_hout == INVALID_HANDLE_VALUE)
        return;

    GetConsoleMode(qconsole_hin, &qconsole_orig_mode);

    // allow mouse wheel scrolling
    SetConsoleMode(qconsole_hin,
            qconsole_orig_mode & ~ENABLE_MOUSE_INPUT);

    FlushConsoleInputBuffer(qconsole_hin);

    GetConsoleScreenBufferInfo(qconsole_hout, &info);
    qconsole_attrib = info.wAttributes;

    SetConsoleTitle("ioquake3 Dedicated Server Console");

    // make cursor invisible
    GetConsoleCursorInfo(qconsole_hout, &qconsole_orig_cursorinfo);
    curs.dwSize = 1;
    curs.bVisible = FALSE;
    SetConsoleCursorInfo(qconsole_hout, &curs);

    // initialize history
    for (i = 0; i < QCONSOLE_HISTORY; i++)
        qconsole_history[ i ][ 0 ] = '\0';
}
开发者ID:zturtleman,项目名称:q3rain,代码行数:44,代码来源:con_win32.c

示例9: GetStdHandle

void Apep::initialize(std::string name, int width_ = 80, int height_ = 60) {
    tin  = GetStdHandle(STD_INPUT_HANDLE);
    tout = GetStdHandle(STD_OUTPUT_HANDLE);
    
    SetConsoleTitle(name.c_str());
        
    { // hide console cursor
        CONSOLE_CURSOR_INFO cci;
        GetConsoleCursorInfo(tout, &cci);
        cci.bVisible = false;
        cci.dwSize   = 1;
        SetConsoleCursorInfo(tout, &cci);
    }

    width  = width_;
    height = height_;
    
    assert("width must be > 1!" && width > 1);
    assert("height must be > 1!" && height > 1);
    // resizing console window
    {
        SMALL_RECT cs = { 0, 0, width - 1, height - 1 };
        consoleSize = cs;
        COORD bs      = { width, height };
        buffSize = bs;
        SetConsoleWindowInfo(tout, TRUE, &consoleSize);
        SetConsoleScreenBufferSize(tout, buffSize);
    }

    { // turning off showing keys being pressed
        DWORD mode;
        GetConsoleMode(tin, &mode);
        SetConsoleMode(tin, mode & ~ENABLE_ECHO_INPUT);
    }

    // allocating back buffer
    total_size  = width * height;
    back_buffer = new CHAR_INFO[total_size];
}
开发者ID:rAum,项目名称:asciihack,代码行数:39,代码来源:apep_engine.cpp

示例10: BLUELY_EXCEPTION

VOID CConsole::Init()
{
	m_uiIndent = 0;
	m_hOutput = NULL;

	// create the console
	if ( !AllocConsole() )
	{
		throw BLUELY_EXCEPTION("CConsole::Create", "AllocConsole failed");
	}
	
	// get the handle to std out
	m_hOutput = GetStdHandle(STD_OUTPUT_HANDLE);

	if ( INVALID_HANDLE_VALUE == m_hOutput )
	{
		throw BLUELY_EXCEPTION( "CConsole::Create()", "GetStdHandle() - Output handle - failed" );
	}

	// console title
	SetConsoleTitle("Bluely Logging Console(BLC) - Ver(0.1)");
}
开发者ID:LaoZhongGu,项目名称:RushGame,代码行数:22,代码来源:Console.cpp

示例11: SDLAppCreateWindowsConsole

void SDLAppCreateWindowsConsole() {
    if(using_parent_console || gSDLAppConsoleWindow != 0) return;

    //try to attach to the available console if there is one

    if(SDLAppAttachToConsole()) return;

    //create a console on Windows so users can see messages
    //find an available name for our window

    char consoleTitle[512];
    int console_suffix = 0;
    sprintf(consoleTitle, "%s Console", gSDLAppTitle.c_str());

    while(FindWindow(0, consoleTitle)) {
        sprintf(consoleTitle, "%s Console %d", gSDLAppTitle.c_str(), ++console_suffix);
    }

    AllocConsole();
    SetConsoleTitle(consoleTitle);

    //redirect streams to console
    freopen("conin$", "r", stdin);
    freopen("conout$","w", stdout);
    freopen("conout$","w", stderr);

    gSDLAppConsoleWindow = 0;

    //wait for our console window
    while(gSDLAppConsoleWindow==0) {
        gSDLAppConsoleWindow = FindWindow(0, consoleTitle);
        SDL_Delay(100);
    }

    //disable the close button so the user cant crash the application
    HMENU hm = GetSystemMenu(gSDLAppConsoleWindow, false);
    DeleteMenu(hm, SC_CLOSE, MF_BYCOMMAND);
}
开发者ID:JickLee,项目名称:Core,代码行数:38,代码来源:sdlapp.cpp

示例12: CScreenRestore

REProgress::REProgress(const TCHAR* aszTitle, BOOL abGraphic /*= FALSE*/, const TCHAR* aszFileInfo /*= NULL*/)
	: CScreenRestore(NULL, aszTitle)
{
	_ASSERTE(gpProgress == NULL);
	bEscaped = FALSE;
	bGraphic = abGraphic;
	nAllCount = nCurrent = 0;
	psPercentTitle = psLastTitle = NULL;
	#ifdef _UNICODE
	cFull = 0x2588; cHollow = 0x2591;
	#else
	cFull = '\xB0'; cHollow = '\xDB';
	#endif
	nProgressLen = countof(sProgress)-1;
	if (bGraphic)
	{
		for (int i = 0; i < nProgressLen; i++)
			sProgress[i] = cHollow;
		sProgress[nProgressLen] = 0;
		pszFormat = NULL;
		psLastTitle = (TCHAR*)malloc(2048*sizeof(TCHAR));
		if (!GetConsoleTitle(psLastTitle, 2048)) {
			SafeFree(psLastTitle);
		} else if (aszTitle) {
			int nLen = lstrlen(aszTitle);
			psPercentTitle = (TCHAR*)malloc((nLen+64)*sizeof(TCHAR));
			wsprintf(psPercentTitle, _T("{  0%%} %s"), aszTitle);
			SetConsoleTitle(psPercentTitle);
		}
	} else {
		pszFormat = GetMsg(REExportItemsProgress);
		wsprintf(sProgress, pszFormat, 0, 1);
	}
	nStepDuration = 1000; nCounter = 0; sFileInfo[0] = 0;
	if (aszFileInfo) lstrcpyn(sFileInfo, aszFileInfo, countof(sFileInfo));
	nStartTick = GetTickCount();
	Update(/*(aszFileInfo && aszFileInfo[0]) ? aszFileInfo : NULL*/);
}
开发者ID:alexlav,项目名称:conemu,代码行数:38,代码来源:RE_Progress.cpp

示例13: main

int main( int argc, char **argv )
{
#ifdef _WIN32
    SetConsoleTitle( "Cynosure" );
#else
    struct termios termattr;
    tcgetattr(0, &termattr);
    termattr.c_lflag &= ~(ICANON | ECHO);
    tcsetattr(0, TCSANOW, &termattr);
#endif

    vm_state *state = new vm_state( "floppy_1_44.img", "debug.log", 1024 * 1024 );
    state->CR0.protectedMode    = false;
    state->CR0.emulation        = true;

    EFLAGS.direction = false;

    opcode opcodes[256];
    opcodesGenerate( opcodes );
    
    state->running = true;
    while (state->running)
    {
        opcode currOpcode = opcodes[ CURR_INS ];

        LOG_STREAM << "0x" << std::setw(2) << std::hex << (uint32_t)currOpcode.opc << ": " << currOpcode.name.c_str();

        currOpcode.func( state, currOpcode );
        EIP.r += currOpcode.GetFinalOffset( state );
        
        LOG_STREAM << std::endl;

        //state->LogRegisters( );
    }
    
    delete state;
    return 0;
} 
开发者ID:csersoft,项目名称:cynosure,代码行数:38,代码来源:main.cpp

示例14: GuardedMain

/** 
 * Main entrypoint, guarded by a try ... except.
 * This expects 4 parameters:
 *		The image path and name
 *		The working directory path, which has to be unique to the instigating process and thread.
 *		The parent process Id
 *		The thread Id corresponding to this worker
 */
int32 GuardedMain(int32 argc, TCHAR* argv[])
{
	GEngineLoop.PreInit(argc, argv, TEXT("-NOPACKAGECACHE -Multiprocess"));
#if DEBUG_USING_CONSOLE
	GLogConsole->Show( true );
#endif

#if PLATFORM_WINDOWS
	//@todo - would be nice to change application name or description to have the ThreadId in it for debugging purposes
	SetConsoleTitle(argv[3]);
#endif

	// We just enumerate the shader formats here for debugging.
	const TArray<const class IShaderFormat*>& ShaderFormats = GetShaderFormats();
	check(ShaderFormats.Num());
	TMap<FString, uint16> FormatVersionMap;
	for (int32 Index = 0; Index < ShaderFormats.Num(); Index++)
	{
		TArray<FName> OutFormats;
		ShaderFormats[Index]->GetSupportedFormats(OutFormats);
		check(OutFormats.Num());
		for (int32 InnerIndex = 0; InnerIndex < OutFormats.Num(); InnerIndex++)
		{
			UE_LOG(LogShaders, Display, TEXT("Available Shader Format %s"), *OutFormats[InnerIndex].ToString());
			uint16 Version = ShaderFormats[Index]->GetVersion(OutFormats[InnerIndex]);
			FormatVersionMap.Add(OutFormats[InnerIndex].ToString(), Version);
		}
	}

	LastCompileTime = FPlatformTime::Seconds();

	FWorkLoop::ECommunicationMode Mode = FWorkLoop::ThroughFile;
	FWorkLoop WorkLoop(argv[2], argv[1], argv[4], argv[5], Mode, FormatVersionMap);

	WorkLoop.Loop();

	return 0;
}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:46,代码来源:ShaderCompileWorker.cpp

示例15: DllStartPlugin

NF_EXPORT void DllStartPlugin(NFIPluginManager* pm)
{
#if NF_PLATFORM == NF_PLATFORM_WIN
    SetConsoleTitle("Tutorial6");
#endif
    CREATE_PLUGIN(pm, Tutorial6Plugin)

};

NF_EXPORT void DllStopPlugin(NFIPluginManager* pm)
{
    DESTROY_PLUGIN(pm, Tutorial6Plugin)
};

#endif
//////////////////////////////////////////////////////////////////////////

const int Tutorial6Plugin::GetPluginVersion()
{
    return 0;
}

const std::string Tutorial6Plugin::GetPluginName()
{
    GET_PLUGIN_NAME(Tutorial6Plugin)
}

void Tutorial6Plugin::Install()
{

    REGISTER_MODULE(pPluginManager, HelloWorld6Module)

}

void Tutorial6Plugin::Uninstall()
{
    UNREGISTER_MODULE(pPluginManager, HelloWorld6Module)
}
开发者ID:joyfish,项目名称:NoahGameFrame,代码行数:38,代码来源:Tutorial6Plugin.cpp


注:本文中的SetConsoleTitle函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。