Discussion Locked

VB 6: Icon on formless application

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have written a small application to autoplay from a CD-ROM. It checks for the existance of Internet Explorer on the computer, and if it finds it, opens a web site in it. Execution starts in sub Main(), and the application doesn't have a form.
I drew a custom icon that I want to use for this application, but I can't figure out how to tell VB to use it. It currently resides at ID 1 in a resource file, that is included in the project. I have also tried assigning it to a variable using:

Icon = LoadResPicture(1,vbResIcon)

No matter what I try, the icon never shows up on the Make tab. How do you assign an icon to a formless application?
Ben

5 replies

by donaldsimpson.co.uk

Hi,

I don't have VB on this machine, but am pretty sure you can set the Icon on the Properties Section for the project, and it will be used by the .exe when you make it.
What version are you using?

Donald

by txitguy

Version 6. Thanks, but Peyison's suggestion worked. By the way, the Make tab is part of the Project's property dialog. Thanks anyway.
Ben

by peyison

Ben,

What about including a blank form in your app? You never have to load it so it will never have to be seen, but you'd be able to use its icon in the Make tab.

by txitguy

Thanks, it worked. You'd think that MS would have made another way, I guess they figured an app only needed a custom icon if it had a visible element.
Ben

This discussion is closed to new replies.