Click here to Skip to main content
15,915,093 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCustom toolbars? Pin
Lord Kixdemp4-Jun-08 2:03
Lord Kixdemp4-Jun-08 2:03 
AnswerRe: Custom toolbars? Pin
_AnsHUMAN_ 4-Jun-08 2:07
_AnsHUMAN_ 4-Jun-08 2:07 
GeneralRe: Custom toolbars? Pin
Lord Kixdemp4-Jun-08 5:42
Lord Kixdemp4-Jun-08 5:42 
QuestionHow to get the full path of a file? Pin
CrocodileBuck4-Jun-08 1:57
CrocodileBuck4-Jun-08 1:57 
AnswerRe: How to get the full path of a file? Pin
_AnsHUMAN_ 4-Jun-08 2:02
_AnsHUMAN_ 4-Jun-08 2:02 
GeneralRe: How to get the full path of a file? Pin
CrocodileBuck4-Jun-08 2:17
CrocodileBuck4-Jun-08 2:17 
GeneralRe: How to get the full path of a file? Pin
_AnsHUMAN_ 4-Jun-08 2:23
_AnsHUMAN_ 4-Jun-08 2:23 
GeneralRe: How to get the full path of a file? Pin
CrocodileBuck4-Jun-08 2:44
CrocodileBuck4-Jun-08 2:44 
Yes i tried it, but Cry | :((

Here is the code of the function, it's a lot but i hope it will help!

/************************************************
*  Virtual Function : OnDblclk(....)
*
*  Purpose : Called by the Framework when the user
*            double-click on a the List Control area
*
*  Comment : if the clicked item is a folder, 
*            SelectThisItem(..) function in the 
*            CShellTreeView class is called to
*            expand the the Treeview after searching
*            for the passed character string
*
*************************************************/
void CShellListView::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult) 
{ 
	CString text;
	char szBuff[MAX_PATH];
	CString ptrPath[5];
	int i = 0;

	// User has double-clicked, get the clicked Item
	// depending on the clicked point
	LVHITTESTINFO lvhInf;
	GetCursorPos(&lvhInf.pt);
	ScreenToClient(&lvhInf.pt);
	int item = ListView_HitTest(GetListCtrl().m_hWnd, &lvhInf);
	if((LVHT_ONITEMLABEL & lvhInf.flags ) || (LVHT_ONITEMICON & lvhInf.flags))
	{
		
	
       LPTVITEMDATA* lptvid = NULL;
       lptvid = (LPTVITEMDATA*) m_pMalloc->Alloc (sizeof (LPTVITEMDATA));

	   LVITEM lvi;
	   lvi.mask = LVIF_PARAM;
	   lvi.iItem = lvhInf.iItem;
       ListView_GetItem(GetListCtrl().m_hWnd, &lvi);
	   lptvid = (LPTVITEMDATA*)lvi.lParam;

       ULONG uAttr = SFGAO_FOLDER;
       lptvid->lpsfParent->GetAttributesOf(1, (LPCITEMIDLIST *) &lptvid->lpi, &uAttr);

	   // is the item a Folder
	   if(uAttr & SFGAO_FOLDER)
	   {
		   CShellClass csc;
		   csc.GetName(lptvid->lpsfParent , lptvid->lpi , SHGDN_NORMAL, szBuff);
		   this->m_pShellTreeView->SelectThisItem(szBuff);

		 
		   IShellFolder *psfProgFiles = NULL;
		   HRESULT hr = lptvid->lpsfParent->BindToObject(lptvid->lpi, NULL, IID_IShellFolder, (LPVOID *) &psfProgFiles);
		   if(FAILED(hr))
			   return;
		   lptvid->lpsfParent = psfProgFiles;
		   LVPopulateFiles(lptvid); 
		   
		  

		   text = szBuff;
		   ptrPath[i] = text;
		  //  AfxMessageBox(szBuff);
		   AfxMessageBox(ptrPath[i]);
		   i++;

	   }
       else
	   {

       // display a popup-menu
	// 		ShowStdMenu(FALSE, lptvid);AfxMessageBox(szBuff);

AfxMessageBox(ptrPath[0]+ptrPath[1]+ptrPath[2]+ptrPath[3]);//"It's a file not a folder"
	   }
	}

	*pResult = 0;
}




Best regards
Croc
AnswerRe: How to get the full path of a file? Pin
Michael Schubert4-Jun-08 2:04
Michael Schubert4-Jun-08 2:04 
AnswerRe: How to get the full path of a file? Pin
David Crow4-Jun-08 3:45
David Crow4-Jun-08 3:45 
GeneralRe: How to get the full path of a file? Pin
CrocodileBuck4-Jun-08 4:16
CrocodileBuck4-Jun-08 4:16 
GeneralRe: How to get the full path of a file? Pin
David Crow4-Jun-08 4:41
David Crow4-Jun-08 4:41 
GeneralRe: How to get the full path of a file? Pin
Hamid_RT4-Jun-08 21:13
Hamid_RT4-Jun-08 21:13 
QuestionHow can i get dynamic URL? Pin
sumit.durg4-Jun-08 1:40
sumit.durg4-Jun-08 1:40 
AnswerRe: How can i get dynamic URL? Pin
_AnsHUMAN_ 4-Jun-08 1:58
_AnsHUMAN_ 4-Jun-08 1:58 
GeneralRe: How can i get dynamic URL? Pin
sumit.durg4-Jun-08 3:12
sumit.durg4-Jun-08 3:12 
QuestionRemove the file in use Pin
mihai1234-Jun-08 1:35
mihai1234-Jun-08 1:35 
AnswerRe: Remove the file in use Pin
Michael Schubert4-Jun-08 1:54
Michael Schubert4-Jun-08 1:54 
QuestionRe: Remove the file in use Pin
CPallini4-Jun-08 1:56
mveCPallini4-Jun-08 1:56 
AnswerRe: Remove the file in use Pin
Hamid_RT4-Jun-08 21:10
Hamid_RT4-Jun-08 21:10 
GeneralRe: Remove the file in use Pin
mihai1234-Jun-08 21:16
mihai1234-Jun-08 21:16 
GeneralRe: Remove the file in use Pin
Hamid_RT4-Jun-08 21:32
Hamid_RT4-Jun-08 21:32 
GeneralRe: Remove the file in use Pin
mihai1234-Jun-08 21:43
mihai1234-Jun-08 21:43 
QuestionBitBlt is failing Pin
subramanyeswari4-Jun-08 1:06
subramanyeswari4-Jun-08 1:06 
AnswerRe: BitBlt is failing Pin
CPallini4-Jun-08 1:46
mveCPallini4-Jun-08 1:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.