| View previous topic :: View next topic |
| Author |
Message |
viciouskinid
Joined: 23 Jun 2007 Posts: 136
|
Posted: Sat May 17, 2008 7:01 am Post subject: Icons |
|
|
I was wondering how i could extract the icon from a .ahk file. the below doesnt work.
Gui, Add, Picture, w16 h16 icon1, C:\Users\......\Desktop\.........ahk
I know I could get the Icon from the AHK exe but this wont work for my purposes. i am making a drag and drop program where if you drag the icon into a gui it displays its icon. Any ideas? |
|
| Back to top |
|
 |
Trikster
Joined: 15 Jul 2007 Posts: 1194 Location: Enterprise, Alabama
|
|
| Back to top |
|
 |
viciouskinid
Joined: 23 Jun 2007 Posts: 136
|
Posted: Sat May 17, 2008 9:11 am Post subject: |
|
|
| Ummm. that wont/doesnt work. I am talking about things like word documents, ahk files, picture files. I want to get the link of the files icon when the icon isnt stored in that specific file. |
|
| Back to top |
|
 |
Elesar
Joined: 28 Jun 2007 Posts: 95
|
Posted: Sat May 17, 2008 1:55 pm Post subject: |
|
|
That does work just fine.
Most windows icons are stored in the system32 folder in different DLLs, you just have to do some exploration.
Windows normally just associates a default icon for a file type, the file doesn't call for it specifically. (Unless it is a program, or related to a program, like how an AHK script gets its own icon).
If its an icon from a program, the exe will contain the image.
If you read about the IconEx, you will learn that you can search for an icon and save the image, then you can include that in a resources folder that your script will look into to call the picture that you saved.
Example:
-You want to use the Control Panel icon in your script.
-First, open IconEx and look into the SYSTEM32.DLL (The default on that IconEx v1.0 uses)
-Look through that and you will find the icon (It is icon group 22)
-Right-Click the icon and it will bring up a save-as dialog.
-Save the icon as whatever you want, wherever you want.
-Open you script and edit your Gui, Add section to reflect the location that you saved the icon to. |
|
| Back to top |
|
 |
viciouskinid
Joined: 23 Jun 2007 Posts: 136
|
Posted: Sat May 17, 2008 2:36 pm Post subject: |
|
|
ok still not what i am after. I understand where the icons are stored and how to get them myself but i want my script to do it. I dont want to have to save a heap of icons and have a look up table.
My question is that since for example a .doc file has a specific icon is it possible to have ahk to read that file and pick up the location of the icon directly.
My current script allows you to drag a file that contains icons into a gui and have that icon displayed. I want this to be possible with all files so i can drag any file into my gui. |
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1084 Location: switzerland
|
|
| Back to top |
|
 |
n-l-i-d Guest
|
Posted: Sat May 17, 2008 3:16 pm Post subject: |
|
|
The paths to the icons associated with file extensions are in the registry: HKEY_CLASSES_ROOT > file extension > DefaultIcon
So, extract the paths from the registry and use them with Gui, Add.
HTH |
|
| Back to top |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 582 Location: MN, USA
|
|
| Back to top |
|
 |
|