X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/937013e0fd914d4c42f9f5ec98da665986b93dfa..18caa1e963269d02499b327bb4e7cc2ac48fd67e:/src/msw/slider95.cpp diff --git a/src/msw/slider95.cpp b/src/msw/slider95.cpp index 3a0dbfb80e..1ebdb425dc 100644 --- a/src/msw/slider95.cpp +++ b/src/msw/slider95.cpp @@ -208,17 +208,21 @@ wxSlider::Create(wxWindow *parent, HWND hwndParent = GetHwndOf(parent); for ( size_t n = 0; n < SliderLabel_Last; n++ ) { - (*m_labels)[n] = ::CreateWindow - ( - wxT("STATIC"), - NULL, - WS_CHILD | WS_VISIBLE | SS_CENTER, - 0, 0, 0, 0, - hwndParent, - (HMENU)NewControlId(), - wxGetInstance(), - NULL - ); + wxWindowIDRef lblid = NewControlId(); + + HWND wnd = ::CreateWindow + ( + wxT("STATIC"), + NULL, + WS_CHILD | WS_VISIBLE | SS_CENTER, + 0, 0, 0, 0, + hwndParent, + (HMENU)lblid.GetValue(), + wxGetInstance(), + NULL + ); + + m_labels->Set(n, wnd, lblid); } m_labels->SetFont(GetFont());