How to link icons to program?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
mol
Posts: 3409
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 268 times
Been thanked: 173 times
Contact:

How to link icons to program?

Post by mol »

Maybe my question is trivial, but I can't find how to link some icons to program?
Could somebody help me?

User avatar
gfilatov
Posts: 765
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Has thanked: 31 times
Been thanked: 405 times
Contact:

Post by gfilatov »

mol wrote:Maybe my question is trivial, but I can't find how to link some icons to program?
Could somebody help me?
Marek,

How about to including in your <programname>.rc the following string(s):

// Using a resource file like this, you can include bitmaps, icons and sounds
// inside EXE.
//
// Resource name Resource Type Resource FileName
//
WORLD ICON WORLD.ICO
...
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein

User avatar
mol
Posts: 3409
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 268 times
Been thanked: 173 times
Contact:

Post by mol »

Going this way, I preperad .rc file, but in my opinion, it doesn't work.
If I declare icon in window definition, it appears.
But main program listed in folder has standard icon from ide.
My older project, linked with hmg 2.0 and older IDE has icon.

Maybe something with IDE ???

User avatar
Rathinagiri
Posts: 5324
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 200 times
Been thanked: 210 times
Contact:

Post by Rathinagiri »

Had you mentioned all your resources in the IDE resources page of the Project Browser window? (instead of listing them in a .rc file)

Image

It works fine for me.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
mol
Posts: 3409
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 268 times
Been thanked: 173 times
Contact:

Post by mol »

I have all resources placed in "Resrc." tab:
Image
but still only standard icon appears in my AKORD.EXE

User avatar
Rathinagiri
Posts: 5324
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 200 times
Been thanked: 210 times
Contact:

Post by Rathinagiri »

icon and ICON are the same? And, is there any empty space after the last line?

I don't understand why this happens. :(
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
mol
Posts: 3409
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 268 times
Been thanked: 173 times
Contact:

Post by mol »

thanks! it must be "ICON" not "icon" !!!
So simply then so hard to find error...

Best regards, Marek

User avatar
Rathinagiri
Posts: 5324
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 200 times
Been thanked: 210 times
Contact:

Post by Rathinagiri »

:) Happy that you had solved.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

Kimono59
Posts: 4
Joined: Thu Jan 08, 2009 6:40 pm

Post by Kimono59 »

Ok Hello to all on this forum
i'm new in programming hmg ide : excellent !
i have a problem with icons and bitmaps . I want to include the .bmp of my program in the executable:

Code: Select all

    DEFINE MAIN MENU
        DEFINE POPUP "File"
            MENUITEM "Open" ACTION MsgInfo("Open") IMAGE "info.bmp"
            MENUITEM "Save" ACTION MsgInfo("Save") IMAGE "free.bmp"
            SEPARATOR
            MENUITEM "Exit" ACTION ThisWIndow.Release IMAGE "exit.bmp"
        END POPUP
        DEFINE POPUP "Help"
            MENUITEM "About" ACTION MsgInfo("HMG IDE - Menu Designer")
        END POPUP
    END MENU

END WINDOW
I have include in the ressource of program the list of them like
OPEN BITMAP INFO.BMP
SAVE BITMAP FREE.BMP etc..
But these bitmaps don't link in the exe
(i have try with an rc file but the same pb)
However when i use the resource witn :
WORLD ICO SOMETHING.ICO : no problem
thank's in advance
regards, jean-michel kimono59

Kimono59
Posts: 4
Joined: Thu Jan 08, 2009 6:40 pm

Post by Kimono59 »

Bon a priori on ne veut pas me répondre, dommage, merci quand même !

Post Reply