SHGetFileInfo, producing unexpected results... 
Author Message
 SHGetFileInfo, producing unexpected results...

After spending a fair amount of time playing w/ the SHGetFileInfo function, I have
come across a host of inconsistencies when specifying the following values for
it's uFlags parameter. I'd like to hear if anyone else encountered anything similar
or has any idea why this behavior may be occurring...

1. Subtle and potentially system draining, when SHGFI_ICON is specified
    a copy of the icon pointed to by the hIcon member of SHFILEINFO is
    created. DestroyIcon must be called in order to free system resources
    it occupies. This could almost be expected...

2. SHGFI_ICON does NOT return the handle of the system image list as it
    should, instead it only returns a BOOL, regardless if used alone or OR'd w/
    any other combination of flags.

3. Similarly, SHGFI_SHELLICONSIZE does not return the handle of the system
    image list, it only returns a BOOL, regardless if used alone or OR'd w/ any
    other combination of flags.

4. When the SHGFI_SHELLICONSIZE flag is OR'd w/ any combination of icon
    flags, the size of the icon pointed to by the hIcon member is always 32x32
    pixels, regardless of the Icon settings in the Appearance or Plus! tabs of
    Control Panel's Display properties. DrawIconEx must be use to adjust the
    icon to it's proper size.

5. The SHGFI_ICONLOCATION flag fills the SHFILEINFO szDisplayName
    member only on a few occasions, i.e. when the associated icon of the file
    specified in the SHGetFileInfo's pszPath param resides in certain system
    files, regardless if the specified file is an exe or a file associated w/ an exe.

I have found the remaining flag combinations that were not listed above to
return intended results.

BTW there's nothing in the MSKB, the MS site, the web or in any newsgroup
regarding any of this.

Oh, and while I'm on the subject, has anyone figured out what the following
definitions found all by themselves at the bottom of Shellapi.h apply to...?

(SHGNLI = SHGenerateNewLinkI__ ...?!)

#define SHGNLI_PIDL             0x000000001     // pszLinkTo is a pidl
#define SHGNLI_PREFIXNAME       0x000000002     // Make name "Shortcut to xxx"
#define SHGNLI_NOUNIQUE 0x000000004     // don't do the unique name generation

Brad Martinez


Fri, 19 Nov 1999 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. SHGetFileInfo, producing unexpected results...

2. Adding tables to Report in Crystal Reports 6 produces unexpected results

3. SHGetFileInfo returning unexpected values...

4. SHGetFileInfo returning unexpected values...

5. Automating Mail Merge with VB.Net and Office XP and Office 2000 produces mixed results

6. oracle 8 not producing desired results

7. ASP commands produce no results in browser

8. Crystal reports produces different result in VB than in CR developer

9. Stored procedure doesn't produce results

10. capture data from comm port producing erratic results

11. Unexpected results with currency variable

12. Unexpected result for Round() function


Powered by phpBB® Forum Software