added As/DissociateHandle() and implemented it for MSW (modified patch 972356)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29102 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-09-11 22:17:22 +00:00
parent 4c27e2faf3
commit ed4780ea6e
3 changed files with 35 additions and 6 deletions

View File

@@ -1005,7 +1005,7 @@ void wxWindowMSW::UnsubclassWin()
HWND hwnd = GetHwnd();
if ( hwnd )
{
m_hWnd = 0;
SetHWND(0);
wxCHECK_RET( ::IsWindow(hwnd), wxT("invalid HWND in UnsubclassWin") );
@@ -1021,6 +1021,27 @@ void wxWindowMSW::UnsubclassWin()
}
}
void wxWindowMSW::AssociateHandle(WXWidget handle)
{
if ( m_hWnd )
{
if ( !::DestroyWindow(GetHwnd()) )
wxLogLastError(wxT("DestroyWindow"));
}
WXHWND wxhwnd = (WXHWND)handle;
SetHWND(wxhwnd);
SubclassWin(wxhwnd);
}
void wxWindowMSW::DissociateHandle()
{
// this also calls SetHWND(0) for us
UnsubclassWin();
}
bool wxCheckWindowWndProc(WXHWND hWnd, WXFARPROC wndProc)
{
// Unicows note: the code below works, but only because WNDCLASS contains