electrico Posted May 15, 2009 Share Posted May 15, 2009 Hi everybody. I am new and noob. I looked through the posts about adding background to the exe, tryed UDF, but it is too difficult for me. Can you please help me to add the background image to my script. I will post code and image. This is my code. Image is attached. If you see stupidness in the code, please be so kind to fix it. Hope you will CODE #Autoit3Wrapper_UseUpx=n #AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, image1.jpg, rcdata, TEST_JPG_1, 0 #AutoIt3Wrapper_run_after=upx.exe --best --compress-resources=0 "%out%" #include "GUIConstantsEx.au3" #include "StaticConstants.au3" #include "resources.au3" GUICreate("AGLONA Party 2009", 800, 520) $picl = GuiCtrlCreatePic ("", 0,0,400,150) GuiCtrlSetState (-1, $GUI_DISABLE) _ResourceSetImageToCtrl ($picl, "TEST_JPG_1") $labell = GUICtrlCreateLabel ("this is label over image",00,10,400,25,$$_CENTER) GuiCtrlSetFont (-1, 14) GUICtrlSetColor(-1, 0xffff00) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateGroup("Tusovka", 45, 30, 210, 260) $CheckBox1 = GUICtrlCreateCheckbox("Oleg", 70, 45, 100, 20) $CheckBox2 = GUICtrlCreateCheckbox("Romanich", 70, 75, 100, 20) $CheckBox3 = GUICtrlCreateCheckbox("Zenjka", 70, 105, 100, 20) $CheckBox4 = GUICtrlCreateCheckbox("Shurik", 70, 135, 100, 20) $CheckBox5 = GUICtrlCreateCheckbox("Petro", 70, 165, 100, 20) $CheckBox6 = GUICtrlCreateCheckbox("", 70, 195, 17, 17) GUICtrlCreateLabel("Pashka", 87, 197, 100, 20) GUICtrlSetColor(-1, 0xff0000) GUICtrlCreateGroup("Rasschet produktov", 300, 30, 480, 260) GuiCtrlSetColor (-1, 0x000000) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd Link to comment Share on other sites More sharing options...
Zedna Posted May 15, 2009 Share Posted May 15, 2009 Code looks OK, just check if reshacker.exe and upx.exe are in srcipt directory or system directory or somewhere in Windows Search path. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
electrico Posted May 15, 2009 Author Share Posted May 15, 2009 (edited) Zenda, are you sure the code is ok? I got an error, running the script. Edited May 15, 2009 by electrico Link to comment Share on other sites More sharing options...
Valuater Posted May 15, 2009 Share Posted May 15, 2009 (edited) Here's another way... #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Run_After=upx.exe --best --compress-resources=0 "%out%" #include "GUIConstantsEx.au3" #include "StaticConstants.au3" $Logo_back = @TempDir & "\My-Back.jpg" FileInstall("C:\Temp\My-back.jpg", $Logo_back) ; replace first parameter with the "Real" location of the picture GUICreate("AGLONA Party 2009", 800, 520) $picl = GUICtrlCreatePic($Logo_back, 0, 0, 400, 150) GUICtrlSetState(-1, $GUI_DISABLE) $labell = GUICtrlCreateLabel("this is label over image", 00, 10, 400, 25, $SS_CENTER) GUICtrlSetFont(-1, 14) GUICtrlSetColor(-1, 0xffff00) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateGroup("Tusovka", 45, 30, 210, 260) $CheckBox1 = GUICtrlCreateCheckbox("Oleg", 70, 45, 100, 20) $CheckBox2 = GUICtrlCreateCheckbox("Romanich", 70, 75, 100, 20) $CheckBox3 = GUICtrlCreateCheckbox("Zenjka", 70, 105, 100, 20) $CheckBox4 = GUICtrlCreateCheckbox("Shurik", 70, 135, 100, 20) $CheckBox5 = GUICtrlCreateCheckbox("Petro", 70, 165, 100, 20) $CheckBox6 = GUICtrlCreateCheckbox("", 70, 195, 17, 17) GUICtrlCreateLabel("Pashka", 87, 197, 100, 20) GUICtrlSetColor(-1, 0xff0000) GUICtrlCreateGroup("Rasschet produktov", 300, 30, 480, 260) GUICtrlSetColor(-1, 0x000000) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd 8) Edited May 15, 2009 by Valuater Link to comment Share on other sites More sharing options...
Valuater Posted May 15, 2009 Share Posted May 15, 2009 (edited) Zenda, are you sure the code is ok? I got an error, running the script.Use Scite and it will show you the error and the line it is onyou have...$labell = GUICtrlCreateLabel ("this is label over image",00,10,400,25,$$_CENTER)It should be....$labell = GUICtrlCreateLabel("this is label over image", 00, 10, 400, 25, $SS_CENTER)8) Edited May 15, 2009 by Valuater Link to comment Share on other sites More sharing options...
electrico Posted May 15, 2009 Author Share Posted May 15, 2009 (edited) Valuater, Zedna. Thank you all. Everything works fine with all two variants of code. Just help me how to make all my CheckBox variables white bacground, so they dont looks wrong in my added background of exe. While you are replaying, (if you do) i will try to make it myself Edited May 15, 2009 by electrico Link to comment Share on other sites More sharing options...
Valuater Posted May 15, 2009 Share Posted May 15, 2009 Just do all the checkboxes like I showed you already $CheckBox6 = GUICtrlCreateCheckbox("", 70, 195, 17, 17) GUICtrlCreateLabel("Pashka", 87, 197, 100, 20) GUICtrlSetColor(-1, 0xff0000) ; remove this for the others or use a different color GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) ; I just added this ( you used this above already ) 8) Link to comment Share on other sites More sharing options...
electrico Posted May 18, 2009 Author Share Posted May 18, 2009 (edited) Valuater, can you help me once more pls. I followed your advices and everything is Ok, but one thing isn't. It is like a small shadows around the checkboxes. I post this code, you can watch it yourself. Please help if you know how to remove this small checkbox surroundings. CODE#AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, alus.jpg, rcdata, TEST_JPG_1, 0 #AutoIt3Wrapper_Run_After=upx.exe --best --compress-resources=0 "%out%" #include "GUIConstantsEx.au3" #include "StaticConstants.au3" #include "resources.au3" GUICreate("AGLONA Party 2009", 800, 520) $picl = GUICtrlCreatePic("aglonaready.jpg", 0, 0, 800, 520) GUICtrlSetState(-1, $GUI_DISABLE) _ResourceSetImageToCtrl($picl, "TEST_JPG_1") $labell = GUICtrlCreateLabel("", 00, 10, 400, 25, $SS_CENTER) GUICtrlSetFont(-1, 14) GUICtrlSetColor(-1, 0xffff00) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateGroup("", 45, 35, 210, 260) GuiCtrlCreateLabel("Òóñîâêà", 130, 27, 100, 20) GUICtrlSetFont (-1, 9, 400) GUICtrlSetBkColor (-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor("Òóñîâêà", $GUI_BKCOLOR_TRANSPARENT) $CheckBox1 = GUICtrlCreateCheckbox("", 70, 45, 17, 17) GuiCtrlCreateLabel("Îëåã", 87, 47, 100, 20) GUICtrlSetBkColor (-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor("Îëåã", $GUI_BKCOLOR_TRANSPARENT) $CheckBox2 = GUICtrlCreateCheckbox("", 70, 75, 17, 17) GuiCtrlCreateLabel("Ðîìàíû÷", 87, 77, 100, 20) GUICtrlSetBkColor (-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor("Ðîìàíû÷", $GUI_BKCOLOR_TRANSPARENT) $CheckBox3 = GUICtrlCreateCheckbox("", 70, 105, 17, 17) GuiCtrlCreateLabel("Æåíüêà", 87, 107, 100, 20) GUICtrlSetBkColor (-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor("Æåíüêà", $GUI_BKCOLOR_TRANSPARENT) $CheckBox4 = GUICtrlCreateCheckbox("", 70, 135, 17, 17) GUICtrlCreateLabel("Øóðèê", 87, 137, 100, 20) GUICtrlSetBkColor (-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor("Øóðèê", $GUI_BKCOLOR_TRANSPARENT) $CheckBox5 = GUICtrlCreateCheckbox("", 70, 165, 17, 17) GuiCtrlCreateLabel("Ïåòðî", 87, 167, 100, 20) GUICtrlSetBkColor (-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor("Ïåòðî", $GUI_BKCOLOR_TRANSPARENT) $CheckBox6 = GUICtrlCreateCheckbox("", 70, 195, 17, 17) GUICtrlCreateLabel("Ïàâåë", 87, 197, 100, 20) GUICtrlSetBkColor (-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor("Ïàâåë", $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0xff0000) GUICtrlSetBkColor (-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateGroup("", 300, 35, 460, 260) GuiCtrlCreateLabel("Ðàññ÷¸ò ïðîäóêòîâ", 470, 27, 250, 20) GUICtrlSetFont (-1, 9, 400, 0) GUICtrlSetBkColor (-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor("Ðàññ÷¸ò ïðîäóêòîâ", $GUI_BKCOLOR_TRANSPARENT) ;Input set Produkti i Toplivo Local $input1, $input2, $input3, $input4, $input5, $input6, $input7, $input8 GuiCtrlCreateLabel ("Íàèìåíîâàíèå", 310, 45) GuiCtrlSetBkColor (-1, $GUI_BKCOLOR_TRANSPARENT) GuiCtrlSetColor (-1, 0x660000) $input1 = GuiCtrlCreateInput ("", 310, 70, 100, 18) $input2 = GuiCtrlCreateInput ("", 310, 100, 100, 18) $input3 = GuiCtrlCreateInput ("", 310, 130, 100, 18) $input4 = GuiCtrlCreateInput ("", 310, 160, 100, 18) $input5 = GuiCtrlCreateInput ("", 310, 190, 100, 18) $input6 = GuiCtrlCreateInput ("", 310, 220, 100, 18) $input7 = GuiCtrlCreateInput ("", 310, 250, 100, 18) GuiCtrlCreateLabel ("Òîïëèâî", 310, 300) GuiCtrlSetFont (-1, 9, 400) GuiCtrlSetColor (-1, 0x660000) GUICtrlSetBkColor (-1, $GUI_BKCOLOR_TRANSPARENT) $input8 = GuiCtrlCreateInput ("", 380, 300, 30, 20) ;Input end ;Input set Kolichestvo Local $input9, $input10, $input11, $input12, $input13, $input14, $input15 GuiCtrlCreateLabel ("Êîëè÷åñòâî", 440, 45) GUICtrlSetBkColor (-1, $GUI_BKCOLOR_TRANSPARENT) GuiCtrlSetColor (-1, 0x660000) $input9 = GuiCtrlCreateInput ("", 440, 70, 60, 18) $input10 = GuiCtrlCreateInput ("", 440, 100, 60, 18) $input11 = GuiCtrlCreateInput ("", 440, 130, 60, 18) $input12 = GuiCtrlCreateInput ("", 440, 160, 60, 18) $input13 = GuiCtrlCreateInput ("", 440, 190, 60, 18) $input14 = GuiCtrlCreateInput ("", 440, 220, 60, 18) $input15 = GuiCtrlCreateInput ("", 440, 250, 60, 18) ;Input end ;Input set Cena Local $input16, $input17, $input18, $input19, $input20, $input21, $input22 GuiCtrlCreateLabel ("Öåíà", 530, 45) GUICtrlSetBkColor (-1, $GUI_BKCOLOR_TRANSPARENT) GuiCtrlSetColor (-1, 0x660000) $input16 = GuiCtrlCreateInput ("", 530, 70, 40, 18) $input17 = GuiCtrlCreateInput ("", 530, 100, 40, 18) $input18 = GuiCtrlCreateInput ("", 530, 130, 40, 18) $input19 = GuiCtrlCreateInput ("", 530, 160, 40, 18) $input20 = GuiCtrlCreateInput ("", 530, 190, 40, 18) $input21 = GuiCtrlCreateInput ("", 530, 220, 40, 18) $input22 = GuiCtrlCreateInput ("", 530, 250, 40, 18) ;Input end GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd Thank you ! Edited May 18, 2009 by electrico Link to comment Share on other sites More sharing options...
Valuater Posted May 18, 2009 Share Posted May 18, 2009 Just adjust the size of the control with the actual size of the ckeck-box... example$CheckBox1 = GUICtrlCreateCheckbox("", 70, 45, 13, 15)8) Link to comment Share on other sites More sharing options...
electrico Posted May 19, 2009 Author Share Posted May 19, 2009 You helped me. Thank you. Always at your service, if something needed. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now