Jump to content

Including image and compile


BJJ
 Share

Recommended Posts

Hi

I have a problem becaouse i make program "welcome window"

#include <GUIConstantsEx.au3>

FileInstall("tlo.gif", "C:\D & S\Prezes\Pulpit\www\AutoIT")

GUICreate("Written by ED", 300, 300)

$Logo = GUICtrlCreatePic("C:\D & S\Prezes\Pulpit\www\AutoIT\tlo.gif", 0, 0, 300, 300)

GUICtrlCreateLabel("kopiarka Versia 0.3 Alfa", 30, 10)

GUISetBkColor(0x00E0FFFF)

GUISetState(@SW_SHOW)

Sleep(8000)

GuiSetState(@SW_HIDE)

and when i compile to exe and change or delete tlo.gif file program dont have picture

how can i inject this picture in program permanently ??

secound problem how can i tailor image color to "GUISetBkColor(0x00E0FFFF)"

Link to comment
Share on other sites

  • Moderators

@Quzziy,

To include the picture in your compiled exe, use Zedna's excellent Resources UDF. You can find it here.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

how ??

i must put

#AutoIt3Wrapper_useupx=n

#AutoIt3Wrapper_Res_File_Add=image1.bmp, bitmap, TEST_BMP_1

#AutoIt3Wrapper_run_after="c:\Program Files\AutoIt3\Aut2Exe\upx.exe" --best "%out%"

to my code ??
Link to comment
Share on other sites

  • Moderators

@Quzziy,

Yes, you do need some code like that in your script, but you also need to read the whole topic (all 18 pages because there is lots of good advice in there), download the various scripts in the first post and play with them for a while to understand what is going on.

For example, if you read the topic you will see that you need to use #AutoIt3Wrapper_Run_After=M:\Program\ResHacker\ResHacker.exe -add %out%, %out%, M:\......\MyPic.bmp, bitmap, MYPIC, 0 and not #AutoIt3Wrapper_Res_File_Add which is no longer supported.

Then once you have the resource in the file, you can use the functions within the UDF to utilise it. In your case, displaying the picture would need some code like this:

$hPic = GUICtrlCreatePic("", 20, 10, 100, 100)

_ResourceSetImageToCtrl($hPic, "BMP", $RT_BITMAP)

But I cannot stress enough the need to read the whole topic, download the examples and play with them until you understand how it all works. If you have problems, post some code and help will be provided (if you ask nicely!).

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

So i download ResHack and use this in my cod and compile but dont work

i use

#AutoIt3Wrapper_Run_After=C:\D & S\Prezes\Pulpit\www\AutoIT\ResHack\ResHacker.exe -add %out%, %out%, C:\D & S\Prezes\Pulpit\www\AutoIT\tlox.bmp, Bitmap, MYPIC, 0

Please help me

Link to comment
Share on other sites

  • Moderators

@Quzziy,

What code are you using to display the bitmap within your script? It is not enough just to load it - as I explained above, you need to use the UDF functions to utilise it within your script. For example, something along the lines of the following:

$hPic = GUICtrlCreatePic("", 20, 10, 100, 100)

_ResourceSetImageToCtrl($hPic, "MYPIC", $RT_BITMAP)

It would be helpful if you could post the code you have written (and please use codebox tags if it is long) - then we can see what might be wrong. For instance, have you included the Resources.au3 file? Are you creating a control to hold the resource when it is utilised?

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

#AutoIt3Wrapper_Run_After=C:\D & S\Prezes\Pulpit\www\AutoIT\ResHack\ResHacker.exe -add %out%, %out%, C:\D & S\Prezes\Pulpit\www\AutoIT\tlox.bmp, Bitmap, MYPIC, 0

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Resources.au3>

$Form1 = GUICreate("Kopiarka v0.4 alfa", 396, 305, 470, 351)
$hPic = GUICtrlCreatePic("C:\D & S\Prezes\Pulpit\www\AutoIT\tlox.bmp ", 98, 7, 297, 297, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))

$Button1 = GUICtrlCreateButton("Copy TXT", 0, 7, 89, 89, 0)
$Button2 = GUICtrlCreateButton("Password", 0, 111, 89, 89, 0)
$Button3 = GUICtrlCreateButton("About", 0, 215, 89, 89, 0)

GUISetState()


While 1
$nMsg = GUIGetMsg()

Select
    
    Case $nMsg = $GUI_EVENT_CLOSE
        GUIDelete()
        Exit
        
    Case $nMsg = $Button3
        Guisetstate(@SW_HIDE)
        $Form1 = GUICreate("Kopiarka v0.4 alfa", 396, 305, 470, 351)
        $logo = GUICtrlCreatePic("C:\D & S\Prezes\Pulpit\www\AutoIT\tlo2.jpg", 98, 7, 297, 297, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) ;tutaj wstawic okno z textem
        $Button1 = GUICtrlCreateButton("Copy TXT", 0, 7, 89, 89, 0)
        $Button2 = GUICtrlCreateButton("Password", 0, 111, 89, 89, 0)
        $Button3 = GUICtrlCreateButton("About", 0, 215, 89, 89, 0)
        GUISetState(@SW_SHOW)


     case $nMsg = $Button2 
         MsgBox(0, "", "Na razie nie dostepne") 
         
     case $nMSG = $Button1 
         MsgBox(0, "", "Na razie nie dostepne")      

EndSelect
WEnd


            
        

        

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    
        
            
                
                    Moderators
                
                
                
                
            
        
    

    
        
            
                


    
        
    

                
                
                
                
                    
                        

                    
                
            
        
        
            
                


Melba23
            
            
                Posted 
                
            
        
    
    
        


Melba23
            
        
        
            
                
                    


    
        
    

                    
                        
                    
                    
                        

                    
                
            
            
                Moderators
                
                    
                
            
            
                
                    
                        
                            
                                
                            
                                 31.1k
                            
                                
                            
                        
                        
                            
                                
                                    
                                        
                                        477
                                
                                    
                                
                            
                        
                    
                
            
            
                

    
    
        
I'm old, what's your excuse?
    
    

            
        
    
    
        



    
        
            
                
                    
                    
                        Moderators
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            Posted 
            
            
                
                
            
        
    

    

    

    
        
        
            @Quzziy,Assuming you are using the full version of SciTE4AutoIt3, it looks as if you have successfully stored the BMP as a resource, but$hPic = GUICtrlCreatePic("C:\D & S\Prezes\Pulpit\www\AutoIT\tlox.bmp ", 98, 7, 297, 297, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))is not going to work unless tlox.bmp is available on disk.  Try the following:$hPic = GUICtrlCreatePic("", 98, 7, 297, 297)_ResourceSetImageToCtrl($hPic, "MYPIC", $RT_BITMAP)That creates the control where you want it and then sets the stored resource to the control.I say again - read the whole topic, download the examples and play with them until you understand how it all works.  Zedna has produced a really clever UDF, but you do need to understand how to use it.  It is not difficult - a few hours of trying different things with it will give you the level of understanding you need to make best use of it.By the way, if you are not using the full version of SciTE4AutoIt3, you are not saving the resource to begin with.  The #AutoIt3Wrapper_Run_After line is only valid in that version.  Use ResHacker to make sure that your compiled exe does indeed contain the BMP.M23P.S. Not sure you need the BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS styles!


            
        

        

        
            

    
        

        
            

     Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind



    Open spoiler to see my UDFs:



    
        Spoiler
    

    
        
            ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
        
    



     


        
    

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


BJJ
            
            
                Posted 
                
            
        
    
    
        


BJJ
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Active Members
                
            
            
                
                    
                        
                            
                                
                            
                                 108
                            
                                
                            
                        
                        
                    
                
            
            
                

            
        
    
    
        



    
        
            
                
                    
                        Author
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            Posted 
            
            
                
                
            
        
    

    

    

    
        
        
            when i add this line image dont work before and after compile $Form1 = GUICreate("Kopiarka v0.4 alfa", 396, 305, 470, 351)$hPic = GUICtrlCreatePic("C:\D & S\Prezes\Pulpit\www\AutoIT\tlox.bmp ", 98, 7, 297, 297, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))_ResourceSetImageToCtrl($hPic, "MYPIC", $RT_BITMAP)$Button1 = GUICtrlCreateButton("Copy TXT", 0, 7, 89, 89, 0)$Button2 = GUICtrlCreateButton("Password", 0, 111, 89, 89, 0)$Button3 = GUICtrlCreateButton("About", 0, 215, 89, 89, 0);(


            
        

        

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    
        
            
                
                    Moderators
                
                
                
                
            
        
    

    
        
            
                


    
        
    

                
                
                
                
                    
                        

                    
                
            
        
        
            
                


Melba23
            
            
                Posted 
                
            
        
    
    
        


Melba23
            
        
        
            
                
                    


    
        
    

                    
                        
                    
                    
                        

                    
                
            
            
                Moderators
                
                    
                
            
            
                
                    
                        
                            
                                
                            
                                 31.1k
                            
                                
                            
                        
                        
                            
                                
                                    
                                        
                                        477
                                
                                    
                                
                            
                        
                    
                
            
            
                

    
    
        
I'm old, what's your excuse?
    
    

            
        
    
    
        



    
        
            
                
                    
                    
                        Moderators
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            Posted 
            
            
                
                
            
        
    

    

    

    
        
        
            My friend,I realise that English is not your first language, but you do not seem to be reading what I am trying to tell you. ;-)So before we go any further, please tell me:1. Are you using the full SciTE4AutoIt3 package or just the lite version that came with the AutoIt3 installer?2. Can you find the BMP resource in the compiled file by using Reshacker?3. Does it work if you copy and paste the lines in my last post (ie leaving out the file name and styles from the GUICtrlCreatePic line)?Just to be clear, none of the Resource.au3 UDF functions will work before compile - because it is only in compiling by the AutoIt3Wrapper that the resource is created!  If you do not have the full SciTE package then you have to insert the resource yourself using Reshacker.M23


            
        

        

        
            

    
        

        
            

     Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind



    Open spoiler to see my UDFs:



    
        Spoiler
    

    
        
            ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
        
    



     


        
    

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


BJJ
            
            
                Posted 
                
            
        
    
    
        


BJJ
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Active Members
                
            
            
                
                    
                        
                            
                                
                            
                                 108
                            
                                
                            
                        
                        
                    
                
            
            
                

            
        
    
    
        



    
        
            
                
                    
                        Author
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            Posted 
            
            
                
                
            
        
    

    

    

    
        
        
            
1. Maybe not 
2. No
3. When i past this line   _ResourceSetImageToCtrl($hPic, "MYPIC", $RT_BITMAP) and run script , don't see picture in program 

Thanks for tolerance 


            
        

        

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    
        
            
                
                    Moderators
                
                
                
                
            
        
    

    
        
            
                


    
        
    

                
                
                
                
                    
                        

                    
                
            
        
        
            
                


Melba23
            
            
                Posted 
                
            
        
    
    
        


Melba23
            
        
        
            
                
                    


    
        
    

                    
                        
                    
                    
                        

                    
                
            
            
                Moderators
                
                    
                
            
            
                
                    
                        
                            
                                
                            
                                 31.1k
                            
                                
                            
                        
                        
                            
                                
                                    
                                        
                                        477
                                
                                    
                                
                            
                        
                    
                
            
            
                

    
    
        
I'm old, what's your excuse?
    
    

            
        
    
    
        



    
        
            
                
                    
                    
                        Moderators
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            Posted 
            
            
                
                
            
        
    

    

    

    
        
        
            @Quzziy,Now we are getting somewhere.  If you are not using the full SciTE4AutoIt3 package then the #AutoIt3Wrapper_Run_After line will not store the resource on compile.So you will have to put the resource in the compiled exe yourself using ResHacker.  Then you should be able to use it with Zedna's UDF.But I strongly recommend that you install the full SciTE4AutoIt3 package.  You get a lot more than the lite version that comes with the AutoIt installer - especially the ability to store resources on compile!  You can find it at http://www.autoitscript.com/autoit3/scite/.So, install the full SciTE package or use ResHacker to put the BMP into your exe (which should not be compressed with upx!) and see if you can get it to work then.  If not, we will keep on trying until it does.Jestem szczęśliwe pomagająM23


            
        

        

        
            

    
        

        
            

     Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind



    Open spoiler to see my UDFs:



    
        Spoiler
    

    
        
            ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
        
    



     


        
    

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


BJJ
            
            
                Posted 
                
            
        
    
    
        


BJJ
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Active Members
                
            
            
                
                    
                        
                            
                                
                            
                                 108
                            
                                
                            
                        
                        
                    
                
            
            
                

            
        
    
    
        



    
        
            
                
                    
                        Author
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            Posted 
            
            
                
                
            
        
    

    

    

    
        
        
            
I use latest version frome site ....

when i try put bmp to compiled exe file and i save this file dont work :/ 



Jestem szczęśliwe pomagają

correctly is

Jestem szczęśliwy pomagając or Jestem szczęśliwy kiedy mogę pomóc :)

Link to comment
Share on other sites

  • Moderators

@Quzziy,

OK, no more trying to speak Polish! :-{

Let us go one step at a time. Firstly let us get the resource into the compiled exe. Once we have got the resource in the compiled exe, then we can look at utilising it.

So....

Now you have downloaded the full SciTE package, please post the code you are using at the moment, as well as the contents of the console (the small window at the bottom of SciTE) after compiling. That way we can see what is happening.

If you tried to load the resource using ResHacker, did it actually go in?

In either case, can ResHacker see the resource in the compiled file?

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Maybe instead describe i show :):)

When this line

_ResourceSetImageToCtrl($hPic, "MYPIC", $RT_BITMAP)
be in code (Not compiling only run script)

Posted Image

When i remove this line

_ResourceSetImageToCtrl($hPic, "MYPIC", $RT_BITMAP)
frome code (Not compiling only run script)

Posted Image

========================================================================================

Compilation

Posted Image

compilation error

Posted Image

========================================================================================

ResHack

step 1. picture adding

Posted Image

Posted Image

step 2. added

Posted Image

Posted Image

step 3. Start modified exe by reshack

Posted Image

Posted Image

Link to comment
Share on other sites

  • Moderators

@Quizzy,

I have not forgotten you, but I have a few other things to do first.

I think we are getting somewhere - wait patiently until I have the time to reply fully.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

@Quizzy,

Too cold to play golf and too foggy to go flying - so I can come back and help you!

First problem - why you do not get an image when you run the script:

If you use GUICtrlCreatePic("C:\D & S\Prezes\Pulpit\www\AutoIT\tlo.gif", 0, 0, 300, 300) when you run from SciTE then AutoIt looks for the bmp on file and shows it.

If you add _ResourceSetImageToCtrl($hPic, "MYPIC", $RT_BITMAP) AutoIt tries to show the resource which is only created on compile - so you end up with a blank picture, because there is no resource to show.

Now if you leave the bmp name in the GUICtrlCreatePic when you compile, the compiled exe tries to load the file from disk - and will probably fail - and so the control is not created - and then there is nowhere for the _ResourceSetImageToCtrl to set the image. You MUST use GUICtrlCreatePic with an empty string for the UDF to work.

Summary:

To run from SciTE:

GUICtrlCreatePic("BMP.name",0,0,300,300)

To run compiled:

GUICtrlCreatePic("",0,0,300,300)
_ResourceSetImageToCtrl($hPic, "MYPIC", $RT_BITMAP)

Anything else will NOT work.

Next problem - why you do not get the resource in the file when you compile:

You have spaces in your path to ResHacker! I know it sounds strange, but AutoIt Wrapper will not accept spaces in #AutoIt3Wrapper_Run_After=M:\Program\ResHacker\ResHacker.exe lines - it took me a long time to find that out when I started using Zedna's UDF. If I add a space to my line I get the following:

>Running:M:\Program\Res Hacker\ResHacker.exe -add M:\Program\Au3 Scripts\Test\Quizzy.exe, M:\Program\Au3 Scripts\Test\Quizzy.exe, M:\Program\Au3 Scripts\RandPlayer\Bin\RandPlayer_Play.bmp, bitmap, MYPIC, 0

'M:\Program\Res' is not recognized as an internal or external command,
operable program or batch file.

>M:\Program\Res Hacker\ResHacker.exe -add M:\Program\Au3 Scripts\Test\Quizzy.exe, M:\Program\Au3 Scripts\Test\Quizzy.exe, M:\Program\Au3 Scripts\RandPlayer\Bin\RandPlayer_Play.bmp, bitmap, MYPIC, 0 Ended   rc:1

The bit in the middle looks very similar to the Polish text you have on your screenshot, so I think you are failing to get the resource compiled. Unfortunately I cannot see the return code at the end of the final line - you can see I have rc:1 which means fail.

So, move ResHacker to a folder without spaces in the path and try again!

Final problem - ResHacker failing to load the resource:

LeHuynhNam has given you the answer - ResHacker will not work on upx compiled files. So to add a resource using ResHacker, you must NOT use upx when compiling. Just untick the "Use UPX" checkbox. But if we can get the compile working properly you should not have to use ResHacker at all!

Over to you to try again - I have compiled your code myself using one of my BMPs and it works perfectly if you do everything I have covered above. I get an exe which shows the BMP when run. But you MUST do everything as I have explained.

Good Luck - and ask again if you have problems,

M23

P.S. LeHuynhNam, please do not hijack threads. If you have a new question, start your own thread. :-)

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...