git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52336
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
{
wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
{
+ wxCHECK_MSG( parent, NULL, _T("must have valid parent for a control") );
+
wxString str(wxGetWindowClass(hWnd));
str.UpperCase();
wxString str(wxGetWindowClass(hWnd));
str.UpperCase();
if (win)
{
parent->AddChild(win);
if (win)
{
parent->AddChild(win);
- win->SetEventHandler(win);
- win->SetHWND(hWnd);
- win->SetId(id);
win->SubclassWin(hWnd);
win->AdoptAttributesFromHWND();
win->SetupColours();
win->SubclassWin(hWnd);
win->AdoptAttributesFromHWND();
win->SetupColours();
}
// Make sure the window style (etc.) reflects the HWND style (roughly)
}
// Make sure the window style (etc.) reflects the HWND style (roughly)
-void wxWindow::AdoptAttributesFromHWND(void)
+void wxWindow::AdoptAttributesFromHWND()
- HWND hWnd = (HWND) GetHWND();
- long style = GetWindowLong((HWND) hWnd, GWL_STYLE);
+ SetId(wxGetWindowId(m_hWnd));
+
+ long style = GetWindowLong(GetHwnd(), GWL_STYLE);
if (style & WS_VSCROLL)
m_windowStyle |= wxVSCROLL;
if (style & WS_VSCROLL)
m_windowStyle |= wxVSCROLL;