Announcement

Collapse
No announcement yet.

How does the compiler choose which icon for app (EXE) in windows explorer?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How does the compiler choose which icon for app (EXE) in windows explorer?

    How does the compiler choose which icon it will use for the app (EXE) in windows explorer? The Icon I wanted it to use was the first one I resourced. but the compiler keeps choosing the third icon in the resource file

    HTML Code:
     #COMPILER PBWIN 10.04
     #COMPILE EXE
     #DIM ALL
     #OPTIMIZE CODE OFF
    ' #DEBUG ing actions
     #DEBUG  DISPLAY ON
     #DEBUG  ERROR ON
     '#DEBUG CODE ON
     #TOOLS ON
     #STACK 2000000
     #REGISTER NONE
    '------------------------------------------------------------------------------
    '   ** Includes **
    '------------------------------------------------------------------------------
    #RESOURCE ICON, 111, "Brick.ico"    ' it is in  this folder  C:\POS32\BIN\Brick.ico  same as the basic file
    #PBFORMS BEGIN INCLUDES
    #RESOURCE "MCCMain.pbr"
    %USEMACROS = 1
    #INCLUDE ONCE "WIN32API.INC"
    #INCLUDE ONCE "COMMCTRL.INC"
    #INCLUDE ONCE "PBForms.INC"
    #PBFORMS END INCLUDES
    '#INCLUDE ONCE "NTStatusTrap.inc"
    '#INCLUDE ONCE "Equates.inc"
    #INCLUDE "TemperMax.inc"
    '----------------------------
    '----------------- Recource Files--------------------------------------------
    #RESOURCE BITMAP, 120, "C:\POS32\BIN\possine.bmp"
    #RESOURCE BITMAP, 121, "C:\POS32\BIN\negsine.bmp"
    #RESOURCE BITMAP, 122, "C:\POS32\BIN\acsine.bmp"
    #RESOURCE BITMAP, 123, "C:\POS32\BIN\negsquare.bmp"
    #RESOURCE BITMAP, 124, "C:\POS32\BIN\possquare.bmp"
    #RESOURCE BITMAP, 125, "C:\POS32\BIN\acsquare.bmp"
    #RESOURCE BITMAP, 126, "C:\POS32\BIN\acsaw.bmp"
    #RESOURCE BITMAP, 127, "C:\POS32\BIN\possaw.bmp"
    #RESOURCE BITMAP, 128, "C:\POS32\BIN\negsaw.bmp"
    I also have this version stuff as an include file. This is the #INCLUDE "TemperMax.inc" from above.
    HTML Code:
    #RESOURCE VERSIONINFO
    
    #IF %DEF(%BETAVERSION)
        #RESOURCE FILEFLAGS %VS_FF_PRERELEASE
    #ELSE
        #RESOURCE FILEFLAGS 0
    #ENDIF
    
    #RESOURCE FILEVERSION 1, 0, 0, 0
    #RESOURCE PRODUCTVERSION 1, 0, 0, 0
    
    #RESOURCE STRINGINFO "0409", "04B0"
    
    #RESOURCE VERSION$ "CompanyName",      "Journey Electronics Corp."
    #RESOURCE VERSION$ "FileDescription",  "TemperMax Optimization Software"
    #RESOURCE VERSION$ "FileVersion",      "01.00.0000"
    #RESOURCE VERSION$ "InternalName",     "TemperMax.Inc"
    #RESOURCE VERSION$ "OriginalFilename", "MCCMain.EXE"
    #RESOURCE VERSION$ "LegalCopyright",   "Copyright © 2016 Journey Electronics Corp."
    #RESOURCE VERSION$ "ProductName",      "POS32"
    #RESOURCE VERSION$ "ProductVersion",   "01.00.0000"
    #RESOURCE VERSION$ "Comments",         "This sets version"
    The compiler is choosing icon 2495 or 205 below... I don't understand why, and I don't know how to get the compiler to use the first icon I specified in
    ???????#RESOURCE ICON, 111, "Brick.ico" ' it is in this folder C:\POS32\BIN\Brick.ico same as the basic file above
    RC file as follows:
    HTML Code:
    //#PBForms Created v2.01
    //-----------------------------------------------------------------------------
    // The first line in this file is a PB/Forms comment. It
    // should ALWAYS be the first line of the file.  Other
    // PB/Forms comments are placed at the beginning and end
    // of "Named Blocks" of code that should be edited within
    // PB/Forms only.  Do not edit or delete these comments or
    // PB/Forms will not be able to reread the file correctly.
    // See the PB/Forms documentation for more information.
    // Named blocks begin like this:    //#PBFORMS BEGIN ...
    // Named blocks end like this:      //#PBFORMS END ...
    // Feel free to make changes anywhere else in the file.
    //-----------------------------------------------------------------------------
    
    
    
    //-----------------------------------------------------------------------------
    //  ** Constants **
    //-----------------------------------------------------------------------------
    //#PBForms Begin Constants
    #define IDR_IMGFILE86   238
    #define IDR_IMGFILE12   253
    #define IDR_IMGFILE89   2495  ' this one or the next one
    #define IDR_IMGFILE56   205
    #define IDR_IMGFILE57   206
    #define IDR_IMGFILE58   207
    #define IDR_IMGFILE1    119
    #define IDR_IMGFILE59   208
    #define IDR_IMGFILE60   209
    #define IDR_IMGFILE61   210
    #define IDR_IMGFILE62   211
    #define IDR_IMGFILE63   212
    #define IDR_IMGFILE64   213
    #define IDR_IMGFILE83   235
    #define IDR_IMGFILE66   215
    #define IDR_IMGFILE67   216
    #define IDR_IMGFILE68   217
    #define IDR_IMGFILE69   218
    #define IDR_IMGFILE70   219
    #define IDR_IMGFILE71   220
    #define IDR_IMGFILE72   221
    #define IDR_IMGFILE73   222
    #define IDR_IMGFILE74   223
    #define IDR_IMGFILE75   224
    #define IDR_IMGFILE76   225
    #define IDR_IMGFILE77   226
    #define IDR_IMGFILE78   227
    #define IDR_IMGFILE79   228
    #define IDR_IMGFILE80   229
    #define IDR_IMGFILE81   231
    #define IDR_IMGFILE84   236
    #define IDR_IMGFILE82   234
    #define IDR_IMGFILE87   2494
    //#PBForms End Constants
    //-----------------------------------------------------------------------------
    #include "Resource.h"
    //-----------------------------------------------------------------------------
    //  ** RC Data **
    //-----------------------------------------------------------------------------
    //#PBForms Begin RCData
    IDR_IMGFILE86   ICON   DISCARDABLE "Brick2.ico"
    IDR_IMGFILE12   BITMAP DISCARDABLE "JECLogo.bmp"
    IDR_IMGFILE89   ICON   DISCARDABLE "Limits.ico"
    IDR_IMGFILE56   ICON   DISCARDABLE "Feeder.ico"
    IDR_IMGFILE57   ICON   DISCARDABLE "view.ico"
    IDR_IMGFILE58   ICON   DISCARDABLE "Modulator.ico"
    IDR_IMGFILE1    BITMAP DISCARDABLE "acsquare.bmp"
    IDR_IMGFILE59   ICON   DISCARDABLE "Flask.ico"
    IDR_IMGFILE60   ICON   DISCARDABLE "Stepper.ico"
    IDR_IMGFILE61   ICON   DISCARDABLE "Source.ico"
    IDR_IMGFILE62   ICON   DISCARDABLE "Sleeping.ico"
    IDR_IMGFILE63   ICON   DISCARDABLE "Extuder.ico"
    IDR_IMGFILE64   ICON   DISCARDABLE "Averaging.ico"
    IDR_IMGFILE83   ICON   DISCARDABLE "SlugCutter.ico"
    IDR_IMGFILE66   ICON   DISCARDABLE "GateControl.ico"
    IDR_IMGFILE67   ICON   DISCARDABLE "Wrench.ico"
    IDR_IMGFILE68   ICON   DISCARDABLE "Pump.ico"
    IDR_IMGFILE69   ICON   DISCARDABLE "Buttons2.ico"
    IDR_IMGFILE70   ICON   DISCARDABLE "Espray.ico"
    IDR_IMGFILE71   ICON   DISCARDABLE "RecipeTest.ico"
    IDR_IMGFILE72   ICON   DISCARDABLE "Meter.ico"
    IDR_IMGFILE73   ICON   DISCARDABLE "camera.icon.ico"
    IDR_IMGFILE74   ICON   DISCARDABLE "FilterWheel.ico"
    IDR_IMGFILE75   ICON   DISCARDABLE "ProfiledOutput.ico"
    IDR_IMGFILE76   ICON   DISCARDABLE "ax.ico"
    IDR_IMGFILE77   ICON   DISCARDABLE "Scale.ico"
    IDR_IMGFILE78   ICON   DISCARDABLE "Encoder.ico"
    IDR_IMGFILE79   ICON   DISCARDABLE "camera.ico"
    IDR_IMGFILE80   ICON   DISCARDABLE "settings.ico"
    IDR_IMGFILE81   ICON   DISCARDABLE "MoisttechCamera.ico"
    IDR_IMGFILE84   ICON   DISCARDABLE "Meter2.ico"
    IDR_IMGFILE82   ICON   DISCARDABLE "Speaker.ico"
    IDR_IMGFILE87   ICON   DISCARDABLE "scrapgate.ico"
    //#PBForms End RCData
    //-----------------------------------------------------------------------------
    
    //#PBForms Begin Manifest
    1 24 XPTheme.xml
    //#PBForms End Manifest
    
    There needs to be a metastatement like:
    #RESOURCE EXEICON, 111, "Brick.ico" but I don't know of anything.
    So, how do I make the compiler choose the correct Icon for Windows explorer and more importantly, as the icon displayed in the task bar, below, when the program is running?
    ???????

  • #2
    it is choosing
    IDR_IMGFILE56 ICON DISCARDABLE "Feeder.ico"

    Comment


    • #3
      It takes the lowest numeric ICO. I don't believe the brick.ico is even compiling into your EXE. My understanding is you want either the RES/PBR method of resource inclusion OR the #RESOURCE metastatement. Not both.

      See:

      RES and PBR resources cannot be mixed with any other resources. Once you add a PBR or RES resource, you cannot add any other #RESOURCE metastatements in your program.
      from https://forum.powerbasic.com/forum/a...-metastatement

      Also, your equates do not in any way match your names so it is makes it REAL hard to see it. You might do well to renumber everything so
      Code:
      #DEFINE IDR_IMGFILE84 = 84
      It is a real mess to try to figure out what equate is what value. Either that or don't bother using equates with numbers and use symbolic names instead.



      Also, the taskbar icon / title bar icon is set using the command DIALOG SET ICON
      <b>George W. Bleck</b>
      <img src='http://www.blecktech.com/myemail.gif'>

      Comment


      • #4
        From Help - #Resource:

        RES and PBR resources cannot be mixed with any other resources. Once you add a PBR or RES resource, you cannot add any other #RESOURCE metastatements in your program.

        You have a .PBR resource as well as the ICON. Looks like the compiler is ignoring everything other than the .PBR in line with the above statement.

        Note also:
        The final example, using a .PBR file, will only be supported for a limited period of time.

        Comment


        • #5
          Thanks. Let me play with this then. I will let you all know if I have more problems.

          Comment


          • #6
            Yes guys. I moved everything upwards and all is fine now. thank you.

            Comment


            • #7
              The .pbr file is created by PBForms. It also produces an .rc file that can be converted to .Res or resource meta-statements. But changing anything in the PB output will cause problems with PBForms when using it next time you add/change a dialog. That will be an issue in the future. I like it so I hope they update it at some point not using .PBR. The only info in the .PBR file is PBForms created stuff.

              Comment


              • #8
                " It takes the lowest numeric ICO" Thanks George! That was easy!

                Comment


                • #9
                  Hmmmm.

                  This restriction does not seem to work as it has been stated, I have a hypertext engine I did late last year that has the icon, manifest, toolbar and menu system as RC scripts and a whole host of RCDATA statements in PB as follows.
                  Code:
                      #resource RCDATA, 2000, "rtf_menus\home.rtf"
                      #resource RCDATA, 2001, "rtf_menus\advanced.rtf"
                      #resource RCDATA, 2002, "rtf_menus\library.rtf"
                      #resource RCDATA, 2003, "rtf_menus\macros.rtf"
                  hutch at movsd dot com
                  The MASM Forum

                  www.masm32.com

                  Comment


                  • #10
                    Originally posted by Steve Hutchesson View Post
                    Hmmmm.

                    This restriction does not seem to work as it has been stated, I have a hypertext engine I did late last year that has the icon, manifest, toolbar and menu system as RC scripts and a whole host of RCDATA statements in PB as follows.
                    Code:
                    #resource RCDATA, 2000, "rtf_menus\home.rtf"
                    #resource RCDATA, 2001, "rtf_menus\advanced.rtf"
                    #resource RCDATA, 2002, "rtf_menus\library.rtf"
                    #resource RCDATA, 2003, "rtf_menus\macros.rtf"
                    What restriction? The only one discussed so far that I can see is that .RES and .PBR resource files need to be stand-alone. Nothing in your example relates to that.

                    Comment


                    • #11
                      Restrictions Windows 95, 98, and ME offer limited support for resources. When compiling on one of these versions of Windows, only #RESOURCE RES and #RESOURCE PBR may be used. Other forms of the #RESOURCE metastatement are not functional.

                      RES and PBR resources cannot be mixed with any other resources. Once you add a PBR or RES resource, you cannot add any other #RESOURCE metastatements in your program.
                      ??? Windows version 95, 98 and ME restriction also applies to 2nd paragraph in quote from Help?

                      I have read 2nd para as all versions. Evidence here says not so.

                      Cheers,
                      Dale

                      Comment


                      • #12
                        Originally posted by Dale Yarker View Post
                        ??? Windows version 95, 98 and ME restriction also applies to 2nd paragraph in quote from Help?

                        I have read 2nd para as all versions. Evidence here says not so.

                        Cheers,



                        I read the 2nd para as applying to all versions after ME.

                        The first para tells us that you can't add any #RESOURCE statements other than RES?PBRin earlier Win versions regardless of whether you have a RES/PBR or not.

                        The second para talks about using other #RESOURCE statements, so it must be referring to post ME. The restriction is that those other resources can't be mixed with RES/PBR resources.

                        What "evidence says not so"? I haven't seen anyone actually say that they have successfully combined RES/PBR resources with other resources in any version of Windows.

                        Comment


                        • #13
                          > What restriction? The only one discussed so far that I can see is that .RES and .PBR resource files need to be stand-alone. Nothing in your example relates to that.

                          RC scripts are built into RES files by RC.EXE. With the icon, manifest and menu contained in the RES file, the statements above,
                          Code:
                              #resource RCDATA, 2000, "rtf_menus\home.rtf"
                              #resource RCDATA, 2001, "rtf_menus\advanced.rtf"
                              #resource RCDATA, 2002, "rtf_menus\library.rtf"
                              #resource RCDATA, 2003, "rtf_menus\macros.rtf"
                          Work fine.

                          I gather you are not familiar with RC.EXE.
                          hutch at movsd dot com
                          The MASM Forum

                          www.masm32.com

                          Comment


                          • #14
                            What "evidence says not so"? I haven't seen anyone actually say that they have successfully combined RES/PBR resources with other resources in any version of Windows.
                            Mike in post 1 code. He has both a #RESOURCE pbr file and several other #RESOURCE lines. Question was about wrong icon in explorer, no mention of many items missing. And, Steve using RES and RCDATA. Which would be "other form" after using RES as stated in second sentence of second paragraph. But if it only applies to OLD Windows, then mixing is no problem. You did notice the question marks? I have no need to test myself, I use newer way for images, icons, version, etc etc.
                            Dale

                            Comment

                            Working...
                            X