Wednesday, April 15, 2009

Is a given file shortcut to some other file?

BOOL IsShortcut( LPCTSTR lpctszPath_i )

{

SHFILEINFO shFileInfo = { 0 };

return (( SHGetFileInfo( lpctszPath_i,

0,

&shFileInfo,

sizeof( shFileInfo ),

SHGFI_ATTRIBUTES )) &&

( shFileInfo.dwAttributes & SFGAO_LINK ) == SFGAO_LINK );

}// End IsShortcut

No comments: