X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/11e62fe658531aaa2891351f19bd0a4c076717ae..08bce50191228ae4a423b488beedcc8ef1ebb30c:/src/msw/listbox.cpp diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index e8bfb9b75c..1f8a77955d 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -354,7 +354,7 @@ int wxListBox::FindString(const wxString& s, bool bCase) const if (bCase) return wxItemContainerImmutable::FindString( s, bCase ); - int pos = ListBox_FindStringExact(GetHwnd(), (WPARAM)-1, s); + int pos = ListBox_FindStringExact(GetHwnd(), -1, s); if (pos == LB_ERR) return wxNOT_FOUND; else @@ -776,16 +776,19 @@ bool wxListBox::MSWOnMeasure(WXMEASUREITEMSTRUCT *item) HDC hdc = CreateIC(wxT("DISPLAY"), NULL, NULL, 0); #endif - wxDC dc; - dc.SetHDC((WXHDC)hdc); - dc.SetFont(GetFont()); - - pStruct->itemHeight = dc.GetCharHeight() + 2*OWNER_DRAWN_LISTBOX_EXTRA_SPACE; - pStruct->itemWidth = dc.GetCharWidth(); + { + wxDCTemp dc((WXHDC)hdc); + dc.SetFont(GetFont()); - dc.SetHDC(0); + pStruct->itemHeight = dc.GetCharHeight() + 2*OWNER_DRAWN_LISTBOX_EXTRA_SPACE; + pStruct->itemWidth = dc.GetCharWidth(); + } +#ifdef __WXWINCE__ + ReleaseDC(NULL, hdc); +#else DeleteDC(hdc); +#endif return true; }