The icq menu generates a large amount of flicker on mouse movement. I traced it down to this snippet of code...
If (m_tMI(lIndex).bOwnerDraw) Then ' this is unfortunate LSet tTR = tDIS.rcItem Dim lW As Long, lH As Long lW = tTR.Right - tTR.Left + 1 lH = tTR.Bottom - tTR.Top + 1 tTR.Top = tTR.Top - 1 tTR.Bottom = tTR.Bottom + 1 BitBlt tDIS.hdc, tDIS.rcItem.Left, tDIS.rcItem.Top, lW, lH, lHDC, 0, 0, vbSrcCopy RaiseEvent DrawItem(tDIS.hdc, lIndex, tTR.Left, tTR.Top, tTR.Right, tTR.Bottom, bHighlighted, bChecked, bDisabled, bDoDefault) BitBlt lHDC, 0, 0, lW, lH, tDIS.hdc, tDIS.rcItem.Left, tDIS.rcItem.Top, vbSrcCopy tR.Left = tTR.Left - tDIS.rcItem.Left tR.Top = tTR.Top - tDIS.rcItem.Top + 1 End IfI notice that the event handler draws to the onscreen hDC, I guess this is because the lHDC (offscreen hdc) is just the hdc to the actual menu item itself (a small rectangle?)
Can you recommend a method where I can reduce the flicker by drawing to an offscreen hDC?
|