It is currently Sat May 18, 2013 10:19 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Several icons in an EXE
PostPosted: Sat Nov 26, 2005 12:32 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Sep 16, 2004 9:50 pm
Posts: 614
Location: France
To have an EXE with severals icons
Create a Text file with RC extension and include it as Icon Resource type
You can use absolute or relative Path
Example :
Code:
            ICONE1 ICON "1.ico"
            ICONE2 ICON "2.ico"


If you don't specify an icon in the compiler option, the first icon is used by default .

_________________
DroopyLib & PBFastLib


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 26, 2005 9:34 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4714
Location: Berlin - Germany
>> You can use absolute or relative Path
the PB-Ide doesn't found the Resource by relative Path, only jaPBe can do this.

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Linux Mint 14 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 26, 2005 12:49 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Sep 16, 2004 9:50 pm
Posts: 614
Location: France
You'r in the right :D

JAPBE can use absolute or relative Path
Example :
Quote:
ICONE1 ICON "1.ico"
ICONE2 ICON "2.ico"


PB-IDE must use absolute path
Example :
Quote:
ICONE1 ICON "D:\\1.ico"
ICONE2 ICON "D:\\2.ico"

_________________
DroopyLib & PBFastLib


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 26, 2005 12:55 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Wed Oct 29, 2003 4:35 pm
Posts: 9870
Location: Beyond the pale...
Sorry for the stupid question :roll: , but how do you include a resource file in a PB project? This is something I've not required before.

Thanks.

_________________
I may look like a mule, but I'm not a complete ass.

eScript
Arctic Reports
nxSoftware


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 26, 2005 1:41 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Sep 16, 2004 9:50 pm
Posts: 614
Location: France
JAPBE : Project Options / Resources tab
PB-IDE : Compiler Options / Resources tab

_________________
DroopyLib & PBFastLib


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 26, 2005 1:53 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Wed Oct 29, 2003 4:35 pm
Posts: 9870
Location: Beyond the pale...
Doh!

I think this combined with your other recent post in this section will prove very useful.

Thank you.

_________________
I may look like a mule, but I'm not a complete ass.

eScript
Arctic Reports
nxSoftware


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 26, 2005 3:14 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Oct 16, 2003 8:30 pm
Posts: 1903
Location: South Florida
So does this mean that we can use a .rc file to contain the file information?

- np

_________________
LAPTOP 4GB RAM / XPS M1210 / FULLY LOADED / MOBILE BROADBAND


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 26, 2005 3:22 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Sep 16, 2004 9:50 pm
Posts: 614
Location: France
Code:
ICONE1 ICON "D:\\1.ico"
ICONE2 ICON "D:\\2.ico"


is a content of an RC file

_________________
DroopyLib & PBFastLib


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 26, 2005 3:44 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4714
Location: Berlin - Germany
NoahPhense wrote:
So does this mean that we can use a .rc file to contain the file information?

- np
for example, you can use this:
Code:
1 VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
{
  BLOCK "StringFileInfo"
  {
    BLOCK "040704b0"
    {
      VALUE "ProductName", "Myprogram.exe\0"
      VALUE "ProductVersion", "1.0\0"
      VALUE "FileVersion", "1.0.0.1\0"
      VALUE "FileDescription", "\0"
      VALUE "InternalName", "Myprogram.exe\0"
      VALUE "OriginalFilename", "Myprogram.exe\0"
      VALUE "LegalCopyright", "© 2005 by NoahPhense\0"
    }
  }
  BLOCK "VarFileInfo"
  {
    VALUE "Translation", 0x0407, 0x4b0
  }
}

you can also added icons and other resources

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Linux Mint 14 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 25, 2006 7:11 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Jan 26, 2004 11:39 am
Posts: 288
Location: ITALY
Hi
I want to add a version resource from the command line to a program. First I have made a file called "version.rc" with the text of NoaPhense:

Code:
1 VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
{
  BLOCK "StringFileInfo"
  {
    BLOCK "040704b0"
    {
      VALUE "ProductName", "Myprogram.exe\0"
      VALUE "ProductVersion", "1.0\0"
      VALUE "FileVersion", "1.0.0.1\0"
      VALUE "FileDescription", "\0"
      VALUE "InternalName", "Myprogram.exe\0"
      VALUE "OriginalFilename", "Myprogram.exe\0"
      VALUE "LegalCopyright", "© 2005 by NoahPhense\0"
    }
  }
  BLOCK "VarFileInfo"
  {
    VALUE "Translation", 0x0407, 0x4b0
  }
}


And finally I have used the compiler from the command line with the option /resource "c:version.rc" but I have this error:

Polink fatal error file not found "PureBasic.res" :cry:

Why?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 25, 2006 7:28 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4714
Location: Berlin - Germany
Use a batchfile like this:
Quote:
"D:\Programmieren\PureBasic4\Compilers\porc.exe" "Version.rc" ; change Path


In your Application import the compiled Resource like:
Code:
Import "Version.res" : EndImport

I hope this info is useful for you

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Linux Mint 14 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 26, 2006 10:00 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Jan 26, 2004 11:39 am
Posts: 288
Location: ITALY
Hi ts-soft and thanks for your help :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 02, 2006 7:22 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Dec 23, 2005 2:20 pm
Posts: 338
Location: Quebec, Canada
Resources files are only for Windows... in accordance to the manual

Quote:
Since Resources are a specific to the Windows platform only, PB does not include a Library to manage them and they are not further documented here. See documentation on the Windows API and resources for more information.


Then, for people working in cross-platform (or thinking on) is not. :wink:

_________________
http://www.kaizensoft.com


Top
 Profile  
 
 Post subject: Re: Several icons in an EXE
PostPosted: Fri Jan 22, 2010 7:27 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Feb 09, 2006 11:27 pm
Posts: 1716
Some of my programs have more than one icon in it's exe file -- it's not easy to keep such IDE projects portable (on my USB stick), because all icon files need an absolute path :cry:...

So this is a kind of feature request or, at least, a poll which possibilities would allow an easier management for resources. So what kind of improvements could be done, let's start...
• the IDE should allow to add more than only one icon (the best way, fred have to do the job)
• a selfmade tool plays a kind of preprocessor (see below) and adapt pathes, if necessary (slows done each compilation)
• any other ideas?

Michael


___
Principle of Portable-RC.pb
- read source file
- check, if "; AddResource" is present
- <NO>: quit
- <YES>: read resource file, replace vars like %SOURCEPATH% by real values, save backup of original text in a comment line


Top
 Profile  
 
 Post subject: Re: Several icons in an EXE
PostPosted: Fri Jan 22, 2010 7:54 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4714
Location: Berlin - Germany
Michael Vogel wrote:
• any other ideas?

create a "myresource.res" with porc from your script and import this!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: Exabot [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye