PIDL of a selected file
-
Hi I have written an application which i am using to find the file opened through the Open/Save As dialog box. I am able to get only the file name which is opened. Is it possible to get the full path of the file from the file name. Is there anyway by which i can get the PIDL of a selected file in the dialog. Thanks in advance.
-
Hi I have written an application which i am using to find the file opened through the Open/Save As dialog box. I am able to get only the file name which is opened. Is it possible to get the full path of the file from the file name. Is there anyway by which i can get the PIDL of a selected file in the dialog. Thanks in advance.
Yes, u can get the full path of the file by using this function. to display the full path: SHGetPathFromIDList This function converts an item identifier list to a file system path. WINSHELLAPI BOOL WINAPI SHGetPathFromIDList( LPCITEMIDLIST pidl, LPSTR pszPath ); Parameters pidl [in] Pointer to an item identifier list that specifies a file or directory location relative to the root of the namespace (the desktop). pszPath [out] Pointer to a buffer to receive the file system path. This buffer must be at least MAX_PATH characters in size. Return Values TRUE indicates success. FALSE indicates failure. Remarks If the location specified by the pidl parameter is not part of the file system, this function will fail. "If you change then change for the good."
-
Yes, u can get the full path of the file by using this function. to display the full path: SHGetPathFromIDList This function converts an item identifier list to a file system path. WINSHELLAPI BOOL WINAPI SHGetPathFromIDList( LPCITEMIDLIST pidl, LPSTR pszPath ); Parameters pidl [in] Pointer to an item identifier list that specifies a file or directory location relative to the root of the namespace (the desktop). pszPath [out] Pointer to a buffer to receive the file system path. This buffer must be at least MAX_PATH characters in size. Return Values TRUE indicates success. FALSE indicates failure. Remarks If the location specified by the pidl parameter is not part of the file system, this function will fail. "If you change then change for the good."
-
Thanks . But that function will convert the PIDL to a path. My question is how to get the PIDL of a selected file.
-
Hi I have written an application which i am using to find the file opened through the Open/Save As dialog box. I am able to get only the file name which is opened. Is it possible to get the full path of the file from the file name. Is there anyway by which i can get the PIDL of a selected file in the dialog. Thanks in advance.
If you are using CFileDialog, call CFileDialog::GetPathName() for the complete path to the selected file. If you are not using MFC then OPENFILENAME::lpstrFile will contain the complete path to the file.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04 "There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05 Within you lies the power for good - Use it!
-
If you are using CFileDialog, call CFileDialog::GetPathName() for the complete path to the selected file. If you are not using MFC then OPENFILENAME::lpstrFile will contain the complete path to the file.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04 "There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05 Within you lies the power for good - Use it!