On Wed, 2005-05-18 at 00:31 -0500, James Hawkins wrote:
- LVHITTESTINFO lvHitTestInfo;
- INT nItem;
- if (infoPtr->bLButtonDown)
- {
lvHitTestInfo.pt = infoPtr->ptClickPos;
nItem = LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE,
TRUE);
if (DragDetect(infoPtr->hwndSelf, infoPtr->ptClickPos))
{
NMLISTVIEW nmlv;
ZeroMemory(&nmlv, sizeof(nmlv));
Why not move the lvHitTestInfo and nItem into the inner scope:
if (infoPtr->bLButtonDown && DragDetect(infoPtr->hwndSelf, infoPtr->ptClickPos)) { LVHITTESTINFO lvHitTestInfo; NMLISTVIEW nmlv;
ZeroMemory(&nmlv, sizeof(nmlv)); lvHitTestInfo.pt = infoPtr->ptClickPos; nmlv.iItem = LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, TRUE); .... }