Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Folder icon from System Icon List
#1
Hi G,

How to get a folder icon from the system icon index ?

I am getting the "unknown file type" icon for folders...see screenshot !

Using the following code :
Code:
Copy      Help
s = tok2[0] ;;filename
j=findcr(s '.'); if(j>=0) se=s+j; else se=0
SHFILEINFO fi
SHGetFileInfo(se 0 &fi sizeof(fi) SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_SMALLICON|SHGFI_TYPENAME|SHGFI_DISPLAYNAME)

Also, fi.szTypeName and fi.szDisplayName return numbers...how do I convert them to string from use with QM ???


Attached Files Image(s)
   
#2
if your looking to rip out all kinds of icons, there are some free progs out there that'll pull them out for you....cant remember the names though.
An old blog on QM coding and automation.

The Macro Hook
#3
My example also shows bad icons? On my computer it works well.

Getting Directory Listing as a Child Window

---

Assign address to lpstr variable:
lpstr s=&fi.szDisplayName
out s
#4
Can't really check your example out "fully"....ftp protocol is blocked in my company lan. Actually, many ports are blocked :-)

Thats the motivation behind this application and many other similar ones I am working on. I am not using FTP from QM "at all". Simple http requests to php scripts which perform my ftp work :-)

Anyway, the system based icons are not really working out...I am gonna employ generic type icons...similar to web based ftp solutions.

Thanks
#5
Found the solution..

Since I was passing only the "name" for getting the icon...it was retrieving "File" icon instead of directory...Included your folder icon line from the example, G.


Forum Jump:


Users browsing this thread: 1 Guest(s)