fix a problem with Unicows (patch 720542)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20411 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -230,9 +230,33 @@ wxFindReplaceDialogImpl::~wxFindReplaceDialogImpl()
|
|||||||
LRESULT APIENTRY wxFindReplaceWindowProc(HWND hwnd, WXUINT nMsg,
|
LRESULT APIENTRY wxFindReplaceWindowProc(HWND hwnd, WXUINT nMsg,
|
||||||
WPARAM wParam, LPARAM lParam)
|
WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
#if wxUSE_UNICODE_MSLU
|
||||||
|
static unsigned long s_lastMsgFlags = 0;
|
||||||
|
|
||||||
|
// This flag helps us to identify the bogus ANSI message
|
||||||
|
// sent by UNICOWS.DLL (see below)
|
||||||
|
// while we're sending our message to the dialog
|
||||||
|
// we ignore possible messages sent in between
|
||||||
|
static bool s_blockMsg = false;
|
||||||
|
#endif // wxUSE_UNICODE_MSLU
|
||||||
|
|
||||||
if ( nMsg == wxFindReplaceDialogImpl::GetFindDialogMessage() )
|
if ( nMsg == wxFindReplaceDialogImpl::GetFindDialogMessage() )
|
||||||
{
|
{
|
||||||
FINDREPLACE *pFR = (FINDREPLACE *)lParam;
|
FINDREPLACE *pFR = (FINDREPLACE *)lParam;
|
||||||
|
|
||||||
|
#if wxUSE_UNICODE_MSLU
|
||||||
|
// This is a hack for a MSLU problem: Versions up to 1.0.4011
|
||||||
|
// of UNICOWS.DLL send the correct UNICODE item after button press
|
||||||
|
// and a bogus ANSI mode item right after this, so lets ignore
|
||||||
|
// the second bogus message
|
||||||
|
if ( s_lastMsgFlags == pFR->Flags )
|
||||||
|
{
|
||||||
|
s_lastMsgFlags = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
s_lastMsgFlags = pFR->Flags;
|
||||||
|
#endif // wxUSE_UNICODE_MSLU
|
||||||
|
|
||||||
wxFindReplaceDialog *dialog = (wxFindReplaceDialog *)pFR->lCustData;
|
wxFindReplaceDialog *dialog = (wxFindReplaceDialog *)pFR->lCustData;
|
||||||
|
|
||||||
// map flags from Windows
|
// map flags from Windows
|
||||||
@@ -288,8 +312,20 @@ LRESULT APIENTRY wxFindReplaceWindowProc(HWND hwnd, WXUINT nMsg,
|
|||||||
event.SetReplaceString(pFR->lpstrReplaceWith);
|
event.SetReplaceString(pFR->lpstrReplaceWith);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if wxUSE_UNICODE_MSLU
|
||||||
|
s_blockMsg = true;
|
||||||
|
#endif // wxUSE_UNICODE_MSLU
|
||||||
|
|
||||||
dialog->Send(event);
|
dialog->Send(event);
|
||||||
|
|
||||||
|
#if wxUSE_UNICODE_MSLU
|
||||||
|
s_blockMsg = false;
|
||||||
|
#endif // wxUSE_UNICODE_MSLU
|
||||||
}
|
}
|
||||||
|
#if wxUSE_UNICODE_MSLU
|
||||||
|
else if ( !s_blockMsg )
|
||||||
|
s_lastMsgFlags = 0;
|
||||||
|
#endif // wxUSE_UNICODE_MSLU
|
||||||
|
|
||||||
WNDPROC wndProc = (WNDPROC)::GetWindowLong(hwnd, GWL_USERDATA);
|
WNDPROC wndProc = (WNDPROC)::GetWindowLong(hwnd, GWL_USERDATA);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user