Announcement

Collapse
No announcement yet.

#resource icon

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

  • #resource icon

    Having trouble with the following code. When I try to compile it I get an error "Cannot access compiler results." Wonder if anyone else is having that problem.

    Code:
    #COMPILE EXE
    'DIM ALL
    
    #RESOURCE ICON, 1, "SEARCH.ICO"
    FUNCTION PBMAIN () AS LONG
    
    END FUNCTION
    Click image for larger version  Name:	search.ico Views:	1 Size:	714 Bytes ID:	776946
    Walt Decker

  • #2
    Hi Watl! I've not had the problem but I see about 10 thread with that phrase in the thread title. Should be some help hereabouts!

    Comment


    • #3
      Thanks, Gary; however, none seem to address the error other than disk full, too many includes, or anti-virus. Other apps I have that use #resource icon won't work either but #resource bitmap compiles fine. This seems to have happened when I went to win10 64bit.

      Is there some way to set the DDT dialog icon other than using DIALOG SET ICON? I saw one that uses setclass, but I do not want all the DDT dialogs in this particular app to have the same icon.
      Walt Decker

      Comment


      • #4
        Walt

        I do not really know what I am talking about BUT

        I have used that successfully - someone else advised me!

        Three differences:

        1 I used the full path address for the icon
        2 I used 100 not 1
        3 I used #INCLUDE "win32api.inc"

        Kerry
        [I]I made a coding error once - but fortunately I fixed it before anyone noticed[/I]
        Kerry Farmer

        Comment


        • #5
          Walt

          When I download the 'Search.ico' from your post I get a 'bitmap with the wrong extension' if I try to open it with IrfanView.

          Check your program with one of the icons supplied with the compiler (eg ..\PBWin10\samples\DDT\Graphic\Hitgame\HITGAME.ICO).
          Rgds, Dave

          Comment


          • #6
            The original problem in this thread "Cannot access compiler results." sounds like a couple virus scanner discussions here.

            Multiple dialogs do not have to have the same icon due to DIALOG SET ICON.
            Code:
            #compile exe
            #dim all
            #resource icon, 100, "DYWinT32.ico" '"SEARCH.ICO"
            #resource icon, 101, ".\RandomByDice\ConsoleIcon.ico"
            %ID_OpenDlg2Btn =1000
            function pbmain () as long
              local hDlg as dword
              dialog new 0, "Dialog One", , , 100, 100, %ds_3dlook or %ds_modalframe or _
                 %ds_nofailcreate or %ds_setfont or %ws_clipsiblings or %ws_dlgframe or _
                 %ws_border or %ws_caption or %ws_popup or %ws_sysmenu, %ws_ex_left or _
                 %ws_ex_ltrreading or %ws_ex_rightscrollbar to hDlg
              dialog set icon hDlg, "#100"
              control add button, hDlg, %ID_OpenDlg2Btn, "Open 2nd Dialog", 5, 5, 70, 20
              dialog show modal hDlg call DlgCB
            end function
            callback function DlgCB() as long
              local hDlg2 as dword
              if cb.msg = %wm_command and _
                 cb.ctl = %ID_OpenDlg2Btn and _
                 cb.ctlmsg = %bn_clicked then
                dialog new cb.hndl, "Dialog Two", 50 , 50, 100, 100, %ds_3dlook or _
                   %ds_modalframe or %ds_nofailcreate or %ds_setfont or %ws_clipsiblings or _
                   %ws_dlgframe or %ws_border or %ws_caption or %ws_popup or %ws_sysmenu, _
                   %ws_ex_left or %ws_ex_ltrreading or %ws_ex_rightscrollbar to hDlg2
                dialog set icon hDlg2, "#101"
                dialog show modal hDlg2 call Dlg2CB
              end if
            end function
            callback function Dlg2CB() as long
            
            end function
            Cheers,
            Dale

            Comment


            • #7
              Originally posted by Dave Biggs View Post
              Walt

              When I download the 'Search.ico' from your post I get a 'bitmap with the wrong extension' if I try to open it with IrfanView.

              Check your program with one of the icons supplied with the compiler (eg ..\PBWin10\samples\DDT\Graphic\Hitgame\HITGAME.ICO).
              Yep, it's not a .ico file, it's a .bmp file with the wrong extension.

              Rename it to .bmp, open it in Irfanview and then save it as a .ico file. Actually, I've done it for you: search.ico
              Attached Files

              Comment


              • #8
                Well, that certainly taught me something. I made the original "icon" with the image edit that came with pbwin10. Guess I didn't watch closely enough when I saved it the app saved it as a bmp rather than an ico.

                Thank you.
                Walt Decker

                Comment


                • #9
                  With ImageEdit the decision between bitmap, icon and cursor is at the beginning.

                  File, New popup with 3 radio buttons and 3 regular buttons.
                  Dale

                  Comment


                  • #10
                    Don't feel bad Walt, I didn't even know Image Edit was there, or I forgot it was there if I ever knew.
                    Rod
                    "To every unsung hero in the universe
                    To those who roam the skies and those who roam the earth
                    To all good men of reason may they never thirst " - from "Heaven Help the Devil" by G. Lightfoot

                    Comment


                    • #11
                      ImageEdit is ancient software (Copyright MS, 1990-1995) and is extremely limited. Lots of better alternatives have been developed over the last 23 years :0

                      It only handles very low res icons/cursors. Maximum size/colour depth is 32x32 pixel, 16 colour Try opening an icon you got from somewhere else to edit it and you will probably get an error message.

                      Comment


                      • #12
                        Some years ago I got tired of doing small images the hard way and bought the professional version of Axialis Icon Workshop. I use it for icons, toolbar image strips and any other small image for any other purpose. There are a few freebies around but if your time and effort matter to you, Axialis Icon Workshop pays for itself very quickly. I also have their cursor editor and just occasionally I knock out a custom cursor for an app.
                        hutch at movsd dot com
                        The MASM Forum

                        www.masm32.com

                        Comment


                        • #13
                          Ditto on Axialis Icon Workshop. Best ever. Used it for over a decade now.

                          Comment

                          Working...
                          X