本文整理汇总了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;
}
示例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;
//.........这里部分代码省略.........