use only ANSI APIs and ConvertUTF8ToACP

This commit is contained in:
Chris Danford
2006-01-17 22:20:27 +00:00
parent b60126a261
commit 7b75640337
4 changed files with 8 additions and 15 deletions
@@ -80,7 +80,7 @@ static HWND GetHwnd()
#endif
}
static wstring GetWindowTitle()
static RString GetWindowTitle()
{
RString s;
#if !defined(SMPACKAGE)
@@ -88,7 +88,7 @@ static wstring GetWindowTitle()
#else
s = PRODUCT_NAME;
#endif
return RStringToWstring( s );
return s;
}
void DialogDriver_Win32::OK( RString sMessage, RString sID )
@@ -176,8 +176,7 @@ void DialogDriver_Win32::Error( RString sError, RString sID )
Dialog::Result DialogDriver_Win32::AbortRetryIgnore( RString sMessage, RString ID )
{
wstring wsMessage = RStringToWstring(sMessage);
switch( MessageBoxW(::GetHwnd(), wsMessage.c_str(), ::GetWindowTitle().c_str(), MB_ABORTRETRYIGNORE|MB_DEFBUTTON3 ) )
switch( MessageBox(::GetHwnd(), ConvertUTF8ToACP(sMessage).c_str(), ConvertUTF8ToACP(::GetWindowTitle()).c_str(), MB_ABORTRETRYIGNORE|MB_DEFBUTTON3 ) )
{
case IDABORT: return Dialog::abort;
case IDRETRY: return Dialog::retry;
@@ -188,8 +187,7 @@ Dialog::Result DialogDriver_Win32::AbortRetryIgnore( RString sMessage, RString I
Dialog::Result DialogDriver_Win32::AbortRetry( RString sMessage, RString sID )
{
wstring wsMessage = RStringToWstring(sMessage);
switch( MessageBoxW(::GetHwnd(), wsMessage.c_str(), ::GetWindowTitle().c_str(), MB_RETRYCANCEL) )
switch( MessageBox(::GetHwnd(), ConvertUTF8ToACP(sMessage).c_str(), ConvertUTF8ToACP(::GetWindowTitle()).c_str(), MB_RETRYCANCEL) )
{
case IDRETRY: return Dialog::retry;
default: ASSERT(0);
@@ -151,8 +151,7 @@ void LoadingWindow_Win32::SetText( CString sText )
HWND hwndItem = ::GetDlgItem( hwnd, msgid[i] );
wstring w = RStringToWstring( asMessageLines[i] );
::SetWindowTextW( hwndItem, w.c_str() );
::SetWindowText( hwndItem, ConvertUTF8ToACP(asMessageLines[i]).c_str() );
}
}
+2 -6
View File
@@ -55,8 +55,6 @@ void DialogUtil::SetHeaderFont( HWND hdlg, int nID )
void DialogUtil::LocalizeDialogAndContents( HWND hdlg )
{
// TODO: No SetWindowTextW on Win9x
const int LARGE_STRING = 256;
char szTemp[LARGE_STRING] = "";
RString sGroup;
@@ -66,8 +64,7 @@ void DialogUtil::LocalizeDialogAndContents( HWND hdlg )
RString s = szTemp;
sGroup = "Tools-"+s;
s = THEME->GetString( sGroup, s );
wstring w = RStringToWstring( s );
::SetWindowTextW( hdlg, w.c_str() );
::SetWindowText( hdlg, ConvertUTF8ToACP(s).c_str() );
}
for( HWND hwndChild = ::GetTopWindow(hdlg); hwndChild != NULL; hwndChild = ::GetNextWindow(hwndChild,GW_HWNDNEXT) )
@@ -77,8 +74,7 @@ void DialogUtil::LocalizeDialogAndContents( HWND hdlg )
if( s.empty() )
continue;
s = THEME->GetString( sGroup, s );
wstring w = RStringToWstring( s );
::SetWindowTextW( hwndChild, w.c_str() );
::SetWindowText( hwndChild, ConvertUTF8ToACP(s).c_str() );
}
}
@@ -302,7 +302,7 @@ void GraphicsWindow::CreateGraphicsWindow( const VideoModeParams &p, bool bForce
{
if( m_bWideWindowClass )
{
if( SetWindowTextW( g_hWndMain, RStringToWstring(p.sWindowTitle).c_str() ) )
if( SetWindowText( g_hWndMain, ConvertUTF8ToACP(p.sWindowTitle).c_str() ) )
break;
}