...

View Full Version : Filling in List control with default values?



Keermalec
04-28-2004, 09:06 PM
Hi, in my windows prog I have a list control and would like to fill it in with two default values. my list control holds a list of file paths that can be modified with an ADD and a REMOVE button. Here is the code for the ADD operation:



void CDlgDlg::OnAddTexPath()
{
BROWSEINFO bi;
ZeroMemory(&bi, sizeof(BROWSEINFO));

bi.hwndOwner = m_hWnd;
bi.ulFlags = BIF_RETURNONLYFSDIRS;

LPITEMIDLIST pidl = SHBrowseForFolder(&bi);

BOOL bRet = FALSE;

TCHAR szFolder[MAX_PATH*2];
szFolder[0] = _T('\0');

if (pidl)
{
if (SHGetPathFromIDList(pidl, szFolder))
{
bRet = TRUE;
}

IMalloc *pMalloc = NULL;
if (SUCCEEDED(SHGetMalloc(&pMalloc)) && pMalloc)
{
pMalloc->Free(pidl);
pMalloc->Release();
}
}

wm_texList.InsertItem(wm_texList.GetItemCount(), szFolder);
}

How would I, for example, display the two following default values in my list control?

"c:\dfsd\nbnb"
"e:\dhfjdhfj\dgfhdgh"

Thanks for your help

:)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum