Click here to Skip to main content
15,887,175 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C++ - Static templated method inside a class Pin
phil.o31-Jan-18 14:07
professionalphil.o31-Jan-18 14:07 
GeneralRe: C++ - Static templated method inside a class Pin
CPallini31-Jan-18 21:20
mveCPallini31-Jan-18 21:20 
GeneralRe: C++ - Static templated method inside a class Pin
Richard MacCutchan31-Jan-18 21:48
mveRichard MacCutchan31-Jan-18 21:48 
GeneralRe: C++ - Static templated method inside a class Pin
phil.o1-Feb-18 3:20
professionalphil.o1-Feb-18 3:20 
GeneralRe: C++ - Static templated method inside a class Pin
Richard MacCutchan1-Feb-18 4:08
mveRichard MacCutchan1-Feb-18 4:08 
QuestionExplorer Pin
Fedrer31-Jan-18 0:12
Fedrer31-Jan-18 0:12 
AnswerRe: Explorer Pin
Richard MacCutchan31-Jan-18 0:49
mveRichard MacCutchan31-Jan-18 0:49 
AnswerRe: Explorer Pin
Jochen Arndt31-Jan-18 1:22
professionalJochen Arndt31-Jan-18 1:22 
The IShellFolder interface is mainly used to manage folders and provide data for clipboard and drag & drop. I suggest to start without using that and implement the tree and list views using standard API functions like FindFirstFileEx and FindNextFile which provide basic information like size, time stamps and attributes.

For additional info like icons and file types use SHGetFileInfo.

To get the owner name for a file or directory use GetNamedSecurityInfo and LookupAccountSid.

Solutions to resolve reparse points (links and mounts) can be found in the web (open with CreateFile with flags FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT and call DeviceIoControl with FSCTL_GET_REPARSE_POINT).

To use the IShellFolder interface you have to get the DesktopFolder and use that to bind to other folders:
C++
LPSHELLFOLDER pDesktopFolder;
::SHGetDesktopFolder(&pDesktopFolder);

LPSHELLFOLDER psfFolder = NULL;
LPITEMIDLIST pFolderPIDL = ::ILCreateFromPath(lpszPath);
HRESULT hRes = pDesktopFolder->BindToObject(
    pFolderPIDL,
    NULL,
    IID_IShellFolder,
    IID_PPV_ARGS(&psfFolder)
);

// Example to get the PIDL of a named file or folder within a folder
// This PIDL can then be used for other IShellFolder operations
LPITEMIDLIST pPIDL;
CString strName; // name within folder
hRes = psfFolder->ParseDisplayName(
    NULL,		 // no hWnd necessary when showing no dialog
    NULL,		 // no bind context
    strName.GetBuffer(), // non-const LPWSTR
    NULL,		 // no need to get number of parsed characters
    &pPIDL,		 // PIDL relative to the parsing folder
    NULL		 // attributes not used
);
strName.ReleaseBuffer();

// Releasing
::CoTaskMemFree(pPIDL);
psfFolder->Release();
::ILFree(pFolderPIDL);
pDesktopFolder->Release();

As you can see there are lot of tasks where some are quite complex.
AnswerRe: Explorer Pin
Randor 31-Jan-18 5:26
professional Randor 31-Jan-18 5:26 
QuestionSize of a window Pin
Anthony Appleyard29-Jan-18 5:05
Anthony Appleyard29-Jan-18 5:05 
AnswerRe: Size of a window Pin
OriginalGriff29-Jan-18 5:07
mveOriginalGriff29-Jan-18 5:07 
AnswerRe: Size of a window Pin
Victor Nijegorodov29-Jan-18 10:49
Victor Nijegorodov29-Jan-18 10:49 
GeneralRe: Size of a window Pin
Anthony Appleyard31-Jan-18 5:56
Anthony Appleyard31-Jan-18 5:56 
GeneralRe: Size of a window Pin
Richard MacCutchan31-Jan-18 6:05
mveRichard MacCutchan31-Jan-18 6:05 
QuestionClass as a DLL Pin
ForNow24-Jan-18 5:37
ForNow24-Jan-18 5:37 
AnswerRe: Class as a DLL Pin
Richard MacCutchan24-Jan-18 6:51
mveRichard MacCutchan24-Jan-18 6:51 
GeneralRe: Class as a DLL Pin
ForNow24-Jan-18 7:28
ForNow24-Jan-18 7:28 
GeneralRe: Class as a DLL Pin
Richard MacCutchan24-Jan-18 7:51
mveRichard MacCutchan24-Jan-18 7:51 
GeneralRe: Class as a DLL Pin
ForNow24-Jan-18 8:09
ForNow24-Jan-18 8:09 
GeneralRe: Class as a DLL Pin
Richard MacCutchan24-Jan-18 9:06
mveRichard MacCutchan24-Jan-18 9:06 
GeneralRe: Class as a DLL Pin
leon de boer24-Jan-18 13:02
leon de boer24-Jan-18 13:02 
AnswerRe: Class as a DLL Pin
Victor Nijegorodov24-Jan-18 9:34
Victor Nijegorodov24-Jan-18 9:34 
QuestionHow to create a thread in C Android NDK Pin
ptr_Electron22-Jan-18 3:47
ptr_Electron22-Jan-18 3:47 
QuestionRe: How to create a thread in C Android NDK Pin
Richard MacCutchan22-Jan-18 4:32
mveRichard MacCutchan22-Jan-18 4:32 
AnswerRe: How to create a thread in C Android NDK Pin
CPallini22-Jan-18 9:49
mveCPallini22-Jan-18 9:49 

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.