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


C++ CStr::MakeLower方法代码示例

本文整理汇总了C++中CStr::MakeLower方法的典型用法代码示例。如果您正苦于以下问题:C++ CStr::MakeLower方法的具体用法?C++ CStr::MakeLower怎么用?C++ CStr::MakeLower使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CStr的用法示例。


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

示例1:

BOOL
CIniFile::ExistsSection( LPCTSTR section )
{
    BOOL rc = FALSE;

    CStr cmp = section;
    cmp.MakeLower();
    void *dummy;
    rc = Sections.Lookup( section, dummy );

    return rc;
}
开发者ID:grainrigi,项目名称:jscripts,代码行数:12,代码来源:IniFile.cpp

示例2: InitInstance

BOOL CMortScriptApp::InitInstance()
{
    SetRegistryKey( L"Mort" );

	CParseCmdLine myCmdLine;
	myCmdLine.ParseCmdLine( m_lpCmdLine );

	TCHAR exe[MAX_PATH];
   ::GetModuleFileName(NULL,exe,MAX_PATH);

	ExecuteFileName = exe;

    CStr file = myCmdLine.Filename; // m_lpCmdLine;
    // file.TrimLeft( '\"' ); file.TrimRight( '\"' );

    if ( myCmdLine.RegOnly || file.IsEmpty() )
    {
        RegisterFileClass();
        RegisterFileType( L".jscr", L"JScripts" );
        RegisterFileType( L".mscr", L"JScripts" );
		if ( !myCmdLine.RegOnly )
		{
			MessageBox( NULL
					  , L".jscr and .mscr extensions registered.\nPlease run any .jscr/.mscr file or read the manual.\n\n"
						L"(c) Mirko Schenk 2005-2007"
					  , L"JScripts V" + CStr( VERSION_INFO )
					  , MB_OK|MB_SETFOREGROUND );
		}
    }
	else
	{
		if (   file.GetLength() >= 4
			/* file.GetLength() >= 8 && file.Right(8).CompareNoCase( L".mortrun" ) == 0
			|| file.GetLength() >= 5 && file.Right(5).CompareNoCase( L".mscr" ) == 0 */
		   )
		{
            CStr mutexName = file;
            mutexName.MakeLower();
#ifdef DESKTOP
			// Windows XP doesn't like some path characters in the mutex' name
			mutexName.Replace( ':', '_' );
			mutexName.Replace( '\\', '/' );
#endif
          MutexName = (LPCTSTR)mutexName;

	        HANDLE mutex = ::CreateMutex(NULL, FALSE, MutexName);

            if ( mutex!=NULL )
	        {
				int exists = ::GetLastError();
		        if ( exists == ERROR_ALREADY_EXISTS) 
		        {
					DWORD procId = GetRunningScriptProcId( file );

					if ( procId != NULL )
					{
						/*
						 CString msg;
						 msg.Format( L"Process ID: %08x", procId );
						 MessageBox( NULL, msg, L"Debug", MB_SETFOREGROUND );
						*/

						FindAppT findApp;
						findApp.procId = procId;
						findApp.hWnd   = NULL;
						::EnumWindows( FindApplicationWindowProc, (LPARAM)&findApp );
						if ( findApp.hWnd != NULL )
						{
							// msg.Format( L"Set foreground window: %08x", findApp.hWnd );
							// MessageBox( NULL, msg, L"Debug", MB_SETFOREGROUND );
							::SetForegroundWindow( findApp.hWnd );
						}
					}
					else
						exists = 0;

					//MessageBox( NULL, L"Process opened", L"Debug", MB_SETFOREGROUND );
					/*
						TCHAR procName[256];
				    	::GetModuleFileName((HMODULE)procId,procName,256);
						//MessageBox( NULL, procName, L"Debug", MB_SETFOREGROUND );
						if ( CString(procName).Right(14).CompareNoCase( L"MortScript.exe" ) == 0 )
						{
							int aw = MessageBox( NULL
											   , L"Script seems to be running. Cancel old script?"
											   , L"Script already running"
											   , MB_YESNO|MB_SETFOREGROUND
											   );
							if ( aw == IDYES )
							{
								RegWriteDW( HKEY_CURRENT_USER, L"Software\\JScripts\\Abort", MutexName, 1 );
								DWORD exitCode = 0;
								SetCursor(LoadStandardCursor(IDC_WAIT));
								for ( int i=0; i<=10; i++ )
								{
									Sleep(1000);
									if ( GetExitCodeProcess( hProc, &exitCode ) == FALSE )
									{
										//MessageBox( NULL, L"GetExitCode failed", L"Debug", MB_SETFOREGROUND );
										exitCode = 0;
//.........这里部分代码省略.........
开发者ID:grainrigi,项目名称:jscripts,代码行数:101,代码来源:MortScriptApp.cpp


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