bringing a program or files icon into rev

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
keyless
Posts: 211
Joined: Wed Dec 12, 2007 11:21 pm

bringing a program or files icon into rev

Post by keyless » Sun Aug 03, 2008 12:14 am

was wondering if it is at all possible to bring a file or programs icon into rev.

For example displaying the icon of a file dragged into a rev text field.

I fully understand how to desplay a image in the text field, just not how to make that image the icon of the program or file.

Since I don't think rev can show ico files I and doubt it could look at PE resources to view icons that way, I imagine one would need to make some sort of snapshot of the icon to use it in rev.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sun Aug 03, 2008 12:26 am

Dear keyless,

I created a solution that kind of works on Mac OS X. I'm still working on it and am also trying to figure out how to do it on Windows.

Currently, I find the icns file in an OSX application package, convert it to a different format, and import that into Rev.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Garrett
Posts: 386
Joined: Sat Apr 08, 2006 8:15 am
Contact:

Post by Garrett » Sun Aug 03, 2008 8:22 pm

Rev can't display the ico image format.

keyless
Posts: 211
Joined: Wed Dec 12, 2007 11:21 pm

Post by keyless » Sun Aug 03, 2008 9:33 pm

Garrett wrote:Rev can't display the ico image format.
That's not really the problem I see, there are plenty of free command line ICO to PNG or whatever exe's, + most single ICO's are really just bmp's. The real problem in this is getting at the ICO as most are stored as resources in EXE's or DLL's.

I'm going to look into resource access with VB script. Found something called AutoIt that might help (amongst other amazing things it might be able to do with a Rev Wrapper).

snapshot method would only work from icon view, not from a detailed or list view.

Garrett
Posts: 386
Joined: Sat Apr 08, 2006 8:15 am
Contact:

Post by Garrett » Mon Aug 04, 2008 1:55 am

Well, yeah, that is kind of your problem.. You asked if there was a way to display an icon from another program in Rev. And the problem is, Rev can't display ico files at all. I was merely pointing out that Rev isn't capable of displaying ico files.

You didn't ask about command line programs or external programs.

I will mention one more thing though... I'm pretty sure it's possible with Rev to find if an exe has an icon, and likely extract it. From there you'd just need to convert it to a format that Rev can display. I used to do this in another language, but it's been so long now, I can't remember the specifics of how to do so :-(

keyless
Posts: 211
Joined: Wed Dec 12, 2007 11:21 pm

Post by keyless » Mon Aug 04, 2008 5:30 am

I'm pretty sure it's possible with Rev to find if an exe has an icon, and likely extract it.
This is the key, would love to see some code for this. I'm still hunting around and will post back if I find anything. Not finding much, as this is so built into Visual Studio based languages (or any language with Shell32.dll access), doesn't seem to be much on it.

I'm not as optomistic and have serious doubts Rev can natively look at PE resources in DLLs or EXEs

The ICO to, lets say PNG, is trivial. As I said there are a lot of good command line converters, Imagemagick for one (but simpler and smaller ico2pngs are better suited)
Last edited by keyless on Mon Aug 04, 2008 7:14 am, edited 1 time in total.

keyless
Posts: 211
Joined: Wed Dec 12, 2007 11:21 pm

Post by keyless » Mon Aug 04, 2008 5:46 am

I found this that might be helpful.

http://www.vbaccelerator.com/codelib/shell/shelicon.htm

I've also found that the iconlocation property for VB scirpt can give icon locations for shortcuts.

I have seen VBScripts (which like REV, have no Windows API access) that can get icons from files, so I am now thinking maybe it can be done if the PE structure can be found in the binary.

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Mon Aug 04, 2008 5:24 pm

This might be a good place to look

http://www.jsware.net/jsware/scripts.php5#iconextr

keyless
Posts: 211
Joined: Wed Dec 12, 2007 11:21 pm

Post by keyless » Mon Aug 04, 2008 5:28 pm

SparkOut wrote:This might be a good place to look

http://www.jsware.net/jsware/scripts.php5#iconextr

Yes, I found that too. Looks promissing. :D

keyless
Posts: 211
Joined: Wed Dec 12, 2007 11:21 pm

Post by keyless » Fri Aug 08, 2008 11:44 pm

keyless wrote:
SparkOut wrote:This might be a good place to look

http://www.jsware.net/jsware/scripts.php5#iconextr

Yes, I found that too. Looks promissing. :D
I'm finding that the best option for this would be a external made to call the SHGetFileInfo API. I am seeing a lot of VB code for this.

Post Reply