mirror of
https://github.com/Open-Shell/Open-Shell-Menu.git
synced 2026-04-13 20:28:31 +10:00
Added option to open folders to their true path
Adds a new function called GetFakeFolder which attempts to find and get the target.lnk file from a fake folder (what Open-Shell uses to pin folders). If detected, InvokeCommand is swapped for a ShellExecute call to the target shortcut. Fixes #555, #653, and by extension, #691.
This commit is contained in:
committed by
Ibuprophen
parent
bb26cec0ec
commit
27e5c2bc74
@@ -60,3 +60,17 @@ bool IsFakeFolder( const wchar_t *fname )
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetFakeFolder( wchar_t *dst, int len, const wchar_t *src )
|
||||
{
|
||||
Sprintf(dst,len,L"%s\\target.lnk",src);
|
||||
if (GetFileAttributes(dst)!=INVALID_FILE_ATTRIBUTES)
|
||||
{
|
||||
wchar_t path[_MAX_PATH];
|
||||
Sprintf(path,_countof(path),L"%s\\desktop.ini",src);
|
||||
DWORD attrib=GetFileAttributes(path);
|
||||
if (attrib!=INVALID_FILE_ATTRIBUTES && (attrib&FILE_ATTRIBUTE_SYSTEM))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -7,3 +7,4 @@
|
||||
bool CreateFakeFolder( const wchar_t *source, const wchar_t *fname );
|
||||
void DeleteFakeFolder( const wchar_t *fname );
|
||||
bool IsFakeFolder( const wchar_t *fname );
|
||||
bool GetFakeFolder( wchar_t *dst, int len, const wchar_t *src );
|
||||
|
||||
Reference in New Issue
Block a user