ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

Definition at line 825 of file shlview.cpp.

Referenced by OnCreate(), and Refresh().

{
    LPENUMIDLIST    pEnumIDList;
    LPITEMIDLIST    pidl;
    DWORD        dwFetched;
    HRESULT        hRes;
    HDPA        hdpa;

    TRACE("%p\n", this);

    /* get the itemlist from the shfolder*/
    hRes = pSFParent->EnumObjects(m_hWnd, SHCONTF_NONFOLDERS | SHCONTF_FOLDERS, &pEnumIDList);
    if (hRes != S_OK)
    {
        if (hRes == S_FALSE)
            return(NOERROR);
        return(hRes);
    }

    /* create a pointer array */
    hdpa = DPA_Create(16);
    if (!hdpa)
    {
        return(E_OUTOFMEMORY);
    }

    /* copy the items into the array*/
    while((S_OK == pEnumIDList->Next(1, &pidl, &dwFetched)) && dwFetched)
    {
        if (DPA_InsertPtr(hdpa, 0x7fff, pidl) == -1)
        {
            SHFree(pidl);
        }
    }

    /* sort the array */
    DPA_Sort(hdpa, CompareItems, (LPARAM)pSFParent.p);

    /*turn the listview's redrawing off*/
    SendMessageA(hWndList, WM_SETREDRAW, FALSE, 0);

    DPA_DestroyCallback( hdpa, fill_list, (void *)this);

    /*turn the listview's redrawing back on and force it to draw*/
    SendMessageA(hWndList, WM_SETREDRAW, TRUE, 0);

    pEnumIDList->Release(); /* destroy the list*/

    return S_OK;
}

Generated on Sat May 26 2012 06:15:52 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.