|
From: Blagoja G. <bla...@gm...> - 2005-10-12 15:09:02
|
Hi,
I write simple aplication from templates and I want to insert icon
(my.ico) into exe file like resource, and after that when I compile and
run application see that icon in the list when click Alt+Tab and in the
left side in the app titlebar.
In test_private.rc file is only this line:
A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "test.ico"
Can somebody explain me syntax of this line or tell me URL on the net
where can I find explanation of .rc file format, please?
When I compile app only see test.exe with icon (test.ico) in the Windows
Explorer and when I start exe default Windows icon IDI_APPLICATION is in
Alt+Tab list.
I know that I must change this lines in the main.c file:
wincl.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
but I don't know how to use LoadIcon function. MSDN for LoadIcon have
little info and don't help me.
Can somebody write simple example for line in .rc file (how to insert
"my.ico" to exe) and example line in main.c file (wincl.hIcon =
LoadIcon(???, ???);) please?
Thanks,
Blagoja
|
|
From: Hind F. <the...@ho...> - 2005-10-12 15:54:29
|
In the ressource file :
100 ICON DISCARDABLE "test.ico"
And be sure that the icon file is in the same directory than the source file
or change the path, for example "res//test.ico" if the icon is in the res
directory.
In the header file or the source file:
#define ID_ICON 100
And in the source file :
wincl.hIcon = LoadIcon (hThisInstance, MAKEINTRESOURCE(ID_ICON));
If you need more information about the syntax or the use of the win32
functions, use the win32 help, try for example this link to download it :
dimcom.uqac.ca/~ecoete/ftp/mmedia/MSHelp/WIN32.HLP
Good Luck
>Date: Wed, 12 Oct 2005 17:08:06 +0200
>
>Hi,
>I write simple aplication from templates and I want to insert icon (my.ico)
>into exe file like resource, and after that when I compile and run
>application see that icon in the list when click Alt+Tab and in the left
>side in the app titlebar.
>
>In test_private.rc file is only this line:
>
>A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "test.ico"
>
>Can somebody explain me syntax of this line or tell me URL on the net where
>can I find explanation of .rc file format, please?
>
>When I compile app only see test.exe with icon (test.ico) in the Windows
>Explorer and when I start exe default Windows icon IDI_APPLICATION is in
>Alt+Tab list.
>
>I know that I must change this lines in the main.c file:
> wincl.hIcon = LoadIcon(NULL, IDI_APPLICATION);
> wincl.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
>but I don't know how to use LoadIcon function. MSDN for LoadIcon have
>little info and don't help me.
>
>Can somebody write simple example for line in .rc file (how to insert
>"my.ico" to exe) and example line in main.c file (wincl.hIcon =
>LoadIcon(???, ???);) please?
>
>Thanks,
>
>Blagoja
_________________________________________________________________
MSN Messenger : discutez en direct avec vos amis !
http://www.msn.fr/msger/default.asp
|
|
From: Blagoja G. <bla...@gm...> - 2005-10-12 16:45:59
|
Hind Fadel wrote: > In the ressource file : > 100 ICON DISCARDABLE "test.ico" > > And be sure that the icon file is in the same directory than the source > file or change the path, for example "res//test.ico" if the icon is in > the res directory. > > In the header file or the source file: > #define ID_ICON 100 > > And in the source file : > wincl.hIcon = LoadIcon (hThisInstance, MAKEINTRESOURCE(ID_ICON)); > > If you need more information about the syntax or the use of the win32 > functions, use the win32 help, try for example this link to download it : > dimcom.uqac.ca/~ecoete/ftp/mmedia/MSHelp/WIN32.HLP > > Good Luck It work, thanks for help. I have another question...can you explain syntax of line in test_private.rc file? A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "test.ico" Why it start with character "A" and in your example is number "100" ? 100 ICON DISCARDABLE "test.ico" What is meaning of "MOVEABLE PURE LOADONCALL" ? Thanks again, Blagoja |
|
From: Hind F. <the...@ho...> - 2005-10-12 17:18:06
|
Any ressource used in a program need to be identified, so useally we use numbers to be sure that every ressource has a single identifier. I never used letters but its have the same role. Concerning the "MOVEABLE LOADONCALL", this attributes are ignored because they concern 16-bit Windows, for the meaning here u are, but as I told u, you can find this information in the win32 help (I just copy/paste them) LOADONCALL : the resource is loaded when called MOVEABLE : the resource can be moved if necessary in order to compact memory. Concerning the "PURE", I must confess that I don't know, I never use it and search to understand it but this attribute is ignored too :) Have good time :) >Date: Wed, 12 Oct 2005 18:44:55 +0200 > >Hind Fadel wrote: >>In the ressource file : >> 100 ICON DISCARDABLE "test.ico" >> >>And be sure that the icon file is in the same directory than the source >>file or change the path, for example "res//test.ico" if the icon is in the >>res directory. >> >>In the header file or the source file: >> #define ID_ICON 100 >> >>And in the source file : >> wincl.hIcon = LoadIcon (hThisInstance, MAKEINTRESOURCE(ID_ICON)); >> >>If you need more information about the syntax or the use of the win32 >>functions, use the win32 help, try for example this link to download it : >>dimcom.uqac.ca/~ecoete/ftp/mmedia/MSHelp/WIN32.HLP >> >>Good Luck > >It work, thanks for help. > >I have another question...can you explain syntax of line in test_private.rc >file? >A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "test.ico" > >Why it start with character "A" and in your example is number "100" ? >100 ICON DISCARDABLE "test.ico" > >What is meaning of "MOVEABLE PURE LOADONCALL" ? > >Thanks again, > >Blagoja > > _________________________________________________________________ MSN Hotmail : antivirus et antispam intégrés http://www.msn.fr/newhotmail/Default.asp?Ath=f |
|
From: Blagoja G. <bla...@gm...> - 2005-10-12 22:41:33
|
> Any ressource used in a program need to be identified, so useally we use > numbers to be sure that every ressource has a single identifier. I never > used letters but its have the same role. > > Concerning the "MOVEABLE LOADONCALL", this attributes are ignored > because they concern 16-bit Windows, for the meaning here u are, but as > I told u, you can find this information in the win32 help (I just > copy/paste them) > > LOADONCALL : the resource is loaded when called > MOVEABLE : the resource can be moved if necessary in order to compact > memory. > > Concerning the "PURE", I must confess that I don't know, I never use it > and search to understand it but this attribute is ignored too :) Sorry, I forgot that I can find that info in Win32 help file. OK, thanks again. :-) Blagoja |
|
From: Per W. <pw...@ia...> - 2005-10-12 22:34:13
|
It starts with an identifier. A in this case is a name - somewhere else that name 'A' is probably mapped to a number. It is possible to have resources with text names but it is _very_ seldom used because of all problems with tools etc... MOVEABLE means that on older platforms (Win16) the memory allocated for the icon may move around in the computer if Win3.1 needs to compact available memory. LOADONCALL means that all info in the resource file must not be loaded at the same time. It is enough for the OS to load the icon from the exe file when it is needed. DISCARDABLE means that if the computer have little memory, the memory allocated for the icon may be reclaimed. You may either run the application without an icon if out of resources, or it may be loaded again later. /Per W On Wed, 12 Oct 2005, Blagoja Gjakovski wrote: > Hind Fadel wrote: > > In the ressource file : > > 100 ICON DISCARDABLE "test.ico" > > > > And be sure that the icon file is in the same directory than the source > > file or change the path, for example "res//test.ico" if the icon is in > > the res directory. > > > > In the header file or the source file: > > #define ID_ICON 100 > > > > And in the source file : > > wincl.hIcon = LoadIcon (hThisInstance, MAKEINTRESOURCE(ID_ICON)); > > > > If you need more information about the syntax or the use of the win32 > > functions, use the win32 help, try for example this link to download it : > > dimcom.uqac.ca/~ecoete/ftp/mmedia/MSHelp/WIN32.HLP > > > > Good Luck > > It work, thanks for help. > > I have another question...can you explain syntax of line in > test_private.rc file? > A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "test.ico" > > Why it start with character "A" and in your example is number "100" ? > 100 ICON DISCARDABLE "test.ico" > > What is meaning of "MOVEABLE PURE LOADONCALL" ? > > Thanks again, > > Blagoja > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, downloads, discussions, > and more. http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Blagoja G. <bla...@gm...> - 2005-10-12 22:47:33
|
> It starts with an identifier. A in this case is a name - somewhere else > that name 'A' is probably mapped to a number. It is possible to have > resources with text names but it is _very_ seldom used because of all > problems with tools etc... > > MOVEABLE means that on older platforms (Win16) the memory allocated for > the icon may move around in the computer if Win3.1 needs to compact > available memory. > > LOADONCALL means that all info in the resource file must not be loaded at > the same time. It is enough for the OS to load the icon from the exe file > when it is needed. > > DISCARDABLE means that if the computer have little memory, the memory > allocated for the icon may be reclaimed. You may either run the > application without an icon if out of resources, or it may be loaded again > later. > > /Per W OK, thanks for explanation. :-) Blagoja |