Ensure wxFindReplaceDialog can be found from its HWND
Associate the dialog HWND with the corresponding C++ object to allow wxGetWindowFromHWND() to work from it, as this will allow to avoid having to handle it specially in several places.
This commit is contained in:
parent
c799a82764
commit
79e057fe06
2 changed files with 7 additions and 1 deletions
|
|
@ -30,6 +30,10 @@
|
|||
|
||||
#include "wx/fdrepdlg.h"
|
||||
|
||||
// Use functions from src/msw/window.cpp
|
||||
extern void wxRemoveHandleAssociation(wxWindowMSW *win);
|
||||
extern void wxAssociateWinWithHandle(HWND hWnd, wxWindowMSW *win);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// functions prototypes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
|
@ -334,6 +338,7 @@ wxFindReplaceDialog::~wxFindReplaceDialog()
|
|||
m_isShown = false;
|
||||
|
||||
// and from destroying our window [again]
|
||||
wxRemoveHandleAssociation(this);
|
||||
m_hWnd = (WXHWND)nullptr;
|
||||
}
|
||||
|
||||
|
|
@ -419,6 +424,7 @@ bool wxFindReplaceDialog::Show(bool show)
|
|||
}
|
||||
|
||||
m_hWnd = (WXHWND)hwnd;
|
||||
wxAssociateWinWithHandle(m_hWnd, this);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ void wxTraceMSWMessage(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
#endif // wxDEBUG_LEVEL >= 2
|
||||
|
||||
void wxRemoveHandleAssociation(wxWindowMSW *win);
|
||||
extern void wxRemoveHandleAssociation(wxWindowMSW *win);
|
||||
extern void wxAssociateWinWithHandle(HWND hWnd, wxWindowMSW *win);
|
||||
|
||||
// get the text metrics for the current font
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue