X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cbe874bd32f35beb3ed8d019c5a24df21a219f8f..9ffdd8cf3c7aa760bec29050688487bb01806b83:/src/msw/fdrepdlg.cpp diff --git a/src/msw/fdrepdlg.cpp b/src/msw/fdrepdlg.cpp index c839d458af..1c2006f35d 100644 --- a/src/msw/fdrepdlg.cpp +++ b/src/msw/fdrepdlg.cpp @@ -4,7 +4,7 @@ // Author: Markus Greither and Vadim Zeitlin // Modified by: // Created: 23/03/2001 -// RCS-ID: +// RCS-ID: $Id$ // Copyright: (c) Markus Greither // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "mswfdrepdlg.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -31,24 +27,21 @@ #if wxUSE_FINDREPLDLG #ifndef WX_PRECOMP + #include "wx/msw/wrapcdlg.h" #include "wx/intl.h" #include "wx/log.h" #endif -#include "wx/msw/private.h" - -#if !defined(__WIN32__) || defined(__WXWINCE__) - #include -#endif - #include "wx/fdrepdlg.h" +#include "wx/msw/mslu.h" + // ---------------------------------------------------------------------------- // functions prototypes // ---------------------------------------------------------------------------- -LRESULT APIENTRY wxFindReplaceWindowProc(HWND hwnd, WXUINT nMsg, - WPARAM wParam, LPARAM lParam); +LRESULT CALLBACK wxFindReplaceWindowProc(HWND hwnd, WXUINT nMsg, + WPARAM wParam, LPARAM lParam); UINT_PTR CALLBACK wxFindReplaceDialogHookProc(HWND hwnd, UINT uiMsg, @@ -178,7 +171,7 @@ void wxFindReplaceDialogImpl::InitString(const wxString& str, *ppStr = new wxChar[len]; wxStrcpy(*ppStr, str); - *pLen = len; + *pLen = (WORD)len; } void wxFindReplaceDialogImpl::InitFindWhat(const wxString& str) @@ -199,14 +192,14 @@ void wxFindReplaceDialogImpl::SubclassDialog(HWND hwnd) // check that we don't subclass the parent twice: this would be a bad idea // as then we'd have infinite recursion in wxFindReplaceWindowProc - if ( !wxCheckWindowWndProc((WXHWND)hwnd, (WXFARPROC)wxFindReplaceWindowProc) ) - { - // set the new one and save the old as user data to allow access to it - // from wxFindReplaceWindowProc - m_oldParentWndProc = wxSetWindowProc(hwnd, wxFindReplaceWindowProc); + wxCHECK_RET( wxGetWindowProc(hwnd) != &wxFindReplaceWindowProc, + _T("can't have more than one find dialog currently") ); - wxSetWindowUserData(hwnd, (void *)m_oldParentWndProc); - } + // set the new one and save the old as user data to allow access to it + // from wxFindReplaceWindowProc + m_oldParentWndProc = wxSetWindowProc(hwnd, wxFindReplaceWindowProc); + + wxSetWindowUserData(hwnd, (void *)m_oldParentWndProc); } wxFindReplaceDialogImpl::~wxFindReplaceDialogImpl() @@ -225,7 +218,7 @@ wxFindReplaceDialogImpl::~wxFindReplaceDialogImpl() // Window Proc for handling RegisterWindowMessage(FINDMSGSTRING) // ---------------------------------------------------------------------------- -LRESULT APIENTRY wxFindReplaceWindowProc(HWND hwnd, WXUINT nMsg, +LRESULT CALLBACK wxFindReplaceWindowProc(HWND hwnd, WXUINT nMsg, WPARAM wParam, LPARAM lParam) { #if wxUSE_UNICODE_MSLU @@ -247,7 +240,7 @@ LRESULT APIENTRY wxFindReplaceWindowProc(HWND hwnd, WXUINT nMsg, // 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 ) + if ( wxUsingUnicowsDll() && s_lastMsgFlags == pFR->Flags ) { s_lastMsgFlags = 0; return 0; @@ -548,4 +541,3 @@ void wxFindReplaceDialog::DoGetClientSize(int *width, int *height) const } #endif // wxUSE_FINDREPLDLG -