Jump to content

Resources UDF


Zedna
 Share

Recommended Posts

Hello,

I try to use this as a kind of dropper. The actions it does work as suppose, but it doesnt seem to grab all files. With different compilement reshacker "forgets" some files.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=ibi.ico
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_Description=Test
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=Test
#AutoIt3Wrapper_Res_requestedExecutionLevel=highestAvailable
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\01.mp3, rcdata, IBI_HC_1, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\bg.jpg, rcdata, IBI_HC_2, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\config.xml, rcdata, IBI_HC_3, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\flippingBook.swf, rcdata, IBI_HC_4, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\index.htm, rcdata, IBI_HC_5, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\Scripts\AC_RunActiveContent.js, rcdata, IBI_HC_6, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletC_001.jpg, rcdata, IBI_HC_61, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletC_002.jpg, rcdata, IBI_HC_62, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\Slide2_01.jpg, rcdata, IBI_HC_63, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\Slide2_02.jpg, rcdata, IBI_HC_64, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\Slide3_01.jpg, rcdata, IBI_HC_65, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\Slide3_02.jpg, rcdata, IBI_HC_66, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn1_001.jpg, rcdata, IBI_HC_67, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn1_002.jpg, rcdata, IBI_HC_68, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn2_001.jpg, rcdata, IBI_HC_69, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn2_002.jpg, rcdata, IBI_HC_70, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn3_001.jpg, rcdata, IBI_HC_71, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn3_002.jpg, rcdata, IBI_HC_72, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn4_001.jpg, rcdata, IBI_HC_73, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn4_002.jpg, rcdata, IBI_HC_74, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn5_001.jpg, rcdata, IBI_HC_75, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn5_002.jpg, rcdata, IBI_HC_76, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn6_001.jpg, rcdata, IBI_HC_77, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn6_002.jpg, rcdata, IBI_HC_78, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn7_001.jpg, rcdata, IBI_HC_79, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn7_002.jpg, rcdata, IBI_HC_80, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn8_001.jpg, rcdata, IBI_HC_81, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn8_002.jpg, rcdata, IBI_HC_82 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn9_001.jpg, rcdata, IBI_HC_83, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn9_002.jpg, rcdata, IBI_HC_84, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn10_001.jpg, rcdata, IBI_HC_85, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn10_002.jpg, rcdata, IBI_HC_86, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn11_001.jpg, rcdata, IBI_HC_87, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn11_002.jpg, rcdata, IBI_HC_88, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn12_001.jpg, rcdata, IBI_HC_89, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn12_002.jpg, rcdata, IBI_HC_90, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn13_001.jpg, rcdata, IBI_HC_91, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn13_002.jpg, rcdata, IBI_HC_92, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn14_001.jpg, rcdata, IBI_HC_93, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn14_002.jpg, rcdata, IBI_HC_94, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn15_001.jpg, rcdata, IBI_HC_95, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn15_002.jpg, rcdata, IBI_HC_96, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn16_001.jpg, rcdata, IBI_HC_97, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\BookletScrn16_002.jpg, rcdata, IBI_HC_98, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\Slide11_01.jpg, rcdata, IBI_HC_99, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\Slide11_02.jpg, rcdata, IBI_HC_100, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\Slide12_01.jpg, rcdata, IBI_HC_101, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\Slide12_02.jpg, rcdata, IBI_HC_102, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\Slide13_01.jpg, rcdata, IBI_HC_103, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, ibi_hc\images\Slide13_02.jpg, rcdata, IBI_HC_104, 0
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****



;#AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, BASS.dll, rcdata, BASS_DLL_1, 0
;#AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, flx.xm, rcdata, FLX_XM_1, 0
;#AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, flx.xm, rcdata, FLX_XM, 0
;#AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, BASS.dll, rcdata, BASS_LIB, 0
;#AutoIt3Wrapper_run_after=upx.exe --best --compress-resources=0 "%out%"

;#include <Bass.au3>
;#include <BassConstants.au3>
#include "resources.au3"
;#include <GUIConstantsEx.au3>
;#include <WindowsConstants.au3>
;#include <ButtonConstants.au3>
#include <StaticConstants.au3>

$foldername = "\hc\"
$outputfolder = @WorkingDir

;_ResourceSaveToFile(@TempDir & "\flx.xm", "FLX_XM_1", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "01.mp3", "IBI_HC_1", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "bg.jpg", "IBI_HC_2", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "config.xml", "IBI_HC_3", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "flippingBook.swf", "IBI_HC_4", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "index.htm", "IBI_HC_5", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "Scripts\AC_RunActiveContent.js", "IBI_HC_6", $RT_RCDATA, 0, 1)

_ResourceSaveToFile($outputfolder & $foldername & "images\BookletC_001.jpg", "IBI_HC_61", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletC_002.jpg", "IBI_HC_62", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\Slide2_01.jpg", "IBI_HC_63", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\Slide2_02.jpg", "IBI_HC_64", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\Slide3_01.jpg", "IBI_HC_65", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\Slide3_02.jpg", "IBI_HC_66", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn1_001.jpg", "IBI_HC_67", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn1_002.jpg", "IBI_HC_68", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn2_001.jpg", "IBI_HC_69", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn2_002.jpg", "IBI_HC_70", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn3_001.jpg", "IBI_HC_71", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn3_002.jpg", "IBI_HC_72", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn4_001.jpg", "IBI_HC_73", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn4_002.jpg", "IBI_HC_74", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn5_001.jpg", "IBI_HC_75", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn5_002.jpg", "IBI_HC_76", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn6_001.jpg", "IBI_HC_77", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn6_002.jpg", "IBI_HC_78", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn7_001.jpg", "IBI_HC_79", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn7_002.jpg", "IBI_HC_80", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn8_001.jpg", "IBI_HC_81", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn8_002.jpg", "IBI_HC_82", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn9_001.jpg", "IBI_HC_83", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn9_002.jpg", "IBI_HC_84", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn10_001.jpg", "IBI_HC_85", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn10_002.jpg", "IBI_HC_86", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn11_001.jpg", "IBI_HC_87", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn11_002.jpg", "IBI_HC_88", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn12_001.jpg", "IBI_HC_89", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn12_002.jpg", "IBI_HC_90", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn13_001.jpg", "IBI_HC_91", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn13_002.jpg", "IBI_HC_92", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn14_001.jpg", "IBI_HC_93", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn14_002.jpg", "IBI_HC_94", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn15_001.jpg", "IBI_HC_95", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn15_002.jpg", "IBI_HC_96", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn16_001.jpg", "IBI_HC_97", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\BookletScrn16_002.jpg", "IBI_HC_98", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\Slide11_01.jpg", "IBI_HC_99", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\Slide11_02.jpg", "IBI_HC_100", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\Slide12_01.jpg", "IBI_HC_101", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\Slide12_02.jpg", "IBI_HC_102", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\Slide13_01.jpg", "IBI_HC_103", $RT_RCDATA, 0, 1)
_ResourceSaveToFile($outputfolder & $foldername & "images\Slide13_02.jpg", "IBI_HC_104", $RT_RCDATA, 0, 1)
ShellExecute($outputfolder & $foldername & "index.htm")

Folder comparison with the original (ibi_hc):

.\01.mp3    identical
.\bg.jpg    only in c:\documents and settings\dk12057\desktop\healthcare demo\ibi_hc
.\config.xml    identical
.\flippingbook.swf  identical
.\index.htm identical
.\images\bookletc_001.jpg   identical
.\images\bookletc_002.jpg   identical
.\images\bookletscrn10_001.jpg  identical
.\images\bookletscrn10_002.jpg  identical
.\images\bookletscrn11_001.jpg  identical
.\images\bookletscrn11_002.jpg  identical
.\images\bookletscrn12_001.jpg  identical
.\images\bookletscrn12_002.jpg  identical
.\images\bookletscrn13_001.jpg  identical
.\images\bookletscrn13_002.jpg  identical
.\images\bookletscrn14_001.jpg  identical
.\images\bookletscrn14_002.jpg  identical
.\images\bookletscrn15_001.jpg  identical
.\images\bookletscrn15_002.jpg  identical
.\images\bookletscrn16_001.jpg  identical
.\images\bookletscrn16_002.jpg  identical
.\images\bookletscrn1_001.jpg   identical
.\images\bookletscrn1_002.jpg   identical
.\images\bookletscrn2_001.jpg   identical
.\images\bookletscrn2_002.jpg   identical
.\images\bookletscrn3_001.jpg   identical
.\images\bookletscrn3_002.jpg   identical
.\images\bookletscrn4_001.jpg   identical
.\images\bookletscrn4_002.jpg   identical
.\images\bookletscrn5_001.jpg   identical
.\images\bookletscrn5_002.jpg   identical
.\images\bookletscrn6_001.jpg   identical
.\images\bookletscrn6_002.jpg   identical
.\images\bookletscrn7_001.jpg   identical
.\images\bookletscrn7_002.jpg   identical
.\images\bookletscrn8_001.jpg   identical
.\images\bookletscrn8_002.jpg   only in c:\documents and settings\dk12057\desktop\healthcare demo\ibi_hc
.\images\bookletscrn9_001.jpg   identical
.\images\bookletscrn9_002.jpg   identical
.\images\slide11_01.jpg identical
.\images\slide11_02.jpg identical
.\images\slide12_01.jpg identical
.\images\slide12_02.jpg identical
.\images\slide13_01.jpg identical
.\images\slide13_02.jpg identical
.\images\slide1_01.jpg  only in c:\documents and settings\dk12057\desktop\healthcare demo\ibi_hc
.\images\slide1_02.jpg  only in c:\documents and settings\dk12057\desktop\healthcare demo\ibi_hc
.\images\slide2_01.jpg  only in c:\documents and settings\dk12057\desktop\healthcare demo\ibi_hc
.\images\slide2_02.jpg  identical
.\images\slide3_01.jpg  identical
.\images\slide3_01.png  only in c:\documents and settings\dk12057\desktop\healthcare demo\ibi_hc
.\images\slide3_02.jpg  identical
.\images\slide4_01.jpg  only in c:\documents and settings\dk12057\desktop\healthcare demo\ibi_hc
.\images\slide4_02.jpg  only in c:\documents and settings\dk12057\desktop\healthcare demo\ibi_hc
.\images\slide5_01.jpg  only in c:\documents and settings\dk12057\desktop\healthcare demo\ibi_hc
.\images\slide5_02.jpg  only in c:\documents and settings\dk12057\desktop\healthcare demo\ibi_hc
.\images\slide6_01.jpg  only in c:\documents and settings\dk12057\desktop\healthcare demo\ibi_hc
.\images\slide6_02.jpg  only in c:\documents and settings\dk12057\desktop\healthcare demo\ibi_hc
.\images\slide7_01.jpg  only in c:\documents and settings\dk12057\desktop\healthcare demo\ibi_hc
.\images\slide7_02.jpg  only in c:\documents and settings\dk12057\desktop\healthcare demo\ibi_hc
.\images\slide8_01.jpg  only in c:\documents and settings\dk12057\desktop\healthcare demo\ibi_hc
.\images\slide8_02.jpg  only in c:\documents and settings\dk12057\desktop\healthcare demo\ibi_hc
.\images\slide9_01.jpg  only in c:\documents and settings\dk12057\desktop\healthcare demo\ibi_hc
.\images\slide9_02.jpg  only in c:\documents and settings\dk12057\desktop\healthcare demo\ibi_hc
.\images\thumbs.db  only in c:\documents and settings\dk12057\desktop\healthcare demo\ibi_hc
.\scripts\ac_runactivecontent.js    identical

Any help would be appreciated

Link to comment
Share on other sites

  • Moderators

flxfxp,

From your code, it looks to me as if you are only loading the resources to save them to file later. In that case I would recommend using the built-in FileInstall function. That way you avoid ResHacker all together.

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

  • 4 weeks later...

In my script returns error 4 in _ResourceGet

If $ResLang <> 0 Then
        $InfoBlock = DllCall("kernel32.dll", "int", "FindResourceExA", "int", $hInstance, "long", $ResType, "str", $ResName, "short", $ResLang)
    Else
        $InfoBlock = DllCall("kernel32.dll", "int", "FindResourceA", "int", $hInstance, "str", $ResName, "long", $ResType)
    EndIf
    
    If @error Then Return SetError(3, 0, 0)
    $InfoBlock = $InfoBlock[0]
    If $InfoBlock = 0 Then Return SetError(4, 0, 0)oÝ÷ ØLZ^¡ù²±Êâ¦Ö®¶­sb5&Vvöâ²¢¢¢¢F&V7FfW27&VFVB'WFôC5w&W%ôuT¢¢¢ ¢4WFôC5w&W%õ&W5ôfÆUôFCÕ&W6÷W&6W2b3#¶6VÆvæ§rÂ%Eõ$4DDÂ$U3¢4VæE&Vvöâ²¢¢¢¢F&V7FfW27&VFVB'WFôC5w&W%ôuT¢¢¢  ¢6æ6ÇVFRfÇCµ&W6÷W&6W2æS2fwC° ¤Æö6Âb33c´D"Ò67&DF"fײgV÷C²b3#³'VV&2æWRgV÷C° ¤uT7&VFRgV÷C²gV÷C²ÂcÂc ¢b33c¶öÆÒuT7G&Ä7&VFU2gV÷C²gV÷C²ÂRÂRÂSÂS¢b33c¶&FÖÒõ&W6÷W&6TvWBgV÷Cµ$U3gV÷C²Âb33cµ%Eõ$4DDÂ3"Âb33c´D"¤bW'&÷"FVâ×6t&÷ÂgV÷C²gV÷C²ÂW'&÷"£·âõ&W6÷W&6U6WDÖvUFô7G&Âb33c¶öÆÂgV÷Cµ$U3gV÷C²Âb33cµ%Eõ$4DDÂb33c´D"£·âuT7G&Å6WDÖvRb33c¶öÆÂb33c¶&FÖ¤uT6WE7FFR¥vÆR 7vF6uTvWD×6r 66RÓ2 W@ VæE7vF6¥tVæ
Link to comment
Share on other sites

In my script returns error 4 in _ResourceGet

You can't use #AutoIt3Wrapper_Res_File_Add

Read CAREFULLY my first post!

You also mixed loading resources from external EXE/DLL with internal resources

Here is corrected code:

#AutoIt3Wrapper_useupx=n
#AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, Resources\acelga.jpg, rcdata, RES1, 0
#AutoIt3Wrapper_run_after=upx.exe --best --compress-resources=0 "%out%"

#include <Resources.au3>

GUICreate("", 600, 600)
$hola = GUICtrlCreatePic("", 5, 5, 590, 590)
_ResourceSetImageToCtrl($hola, "RES1", $RT_RCDATA)
;~ If @error Then MsgBox(0, "", @error)
GUISetState()
While 1
    Switch GUIGetMsg()
       Case -3 
           Exit
    EndSwitch
WEnd
Link to comment
Share on other sites

Now works very fine, but when i'm adding jpg to my compiled script there are some jpg not added, but don't get any error of compiler.

How i get jpg files from a file.res? I'm adding a lot of jpg...

How i create a file.res? with reshacker.exe?

Link to comment
Share on other sites

  • 2 weeks later...

I planned to release new version early this year but I have been badly ill for 2 months

and after then I had other priorities. So it's lesson for me: Don't promise any deadlines :-(

Last few weeks I was thinking about finishing my ideas for changes to my resources UDF

but I'm not sure if it will be in a few weeks or later.

I want to propose some new standard UDFs (not resource related) to AutoIt

and it has higher priority for me.

In meantime I also worked on testing of new Koda versions.

And I'm also working on my another AutoIt's projects currently so resource UDF will be in order after all that.

EDIT: And of course computers are NOT the only one my hobby especcialy when it's fine weather :-)

So if somebody needs proposed changes to my UDF urgently

then rather make your own modified copy of my UDF with your changes

instead of waiting for me to do it.

But I'm still open to ideas for fixing bugs/improvements.

So feel free to post it here.

Edited by Zedna
Link to comment
Share on other sites

  • 3 weeks later...

hi guys ;-)

i got a question...

is it possible that some resources are not released when using _SetBitmapToCtrl?

because i disposed and deleted all my other objects properly i guess, but i thought about that _SendMessage might not be released with _WinAPI_DeleteObject, or at least the bitmap on the control wont be released anymore

it causes a huge memory overload in my script because im refreshing that bitmap each 2 seconds.

would be great to know if its the fault of this function and / or how to solve it ^^

thx for any replys

Link to comment
Share on other sites

hi guys ;-)

i got a question...

is it possible that some resources are not released when using _SetBitmapToCtrl?

because i disposed and deleted all my other objects properly i guess, but i thought about that _SendMessage might not be released with _WinAPI_DeleteObject, or at least the bitmap on the control wont be released anymore

it causes a huge memory overload in my script because im refreshing that bitmap each 2 seconds.

would be great to know if its the fault of this function and / or how to solve it ^^

thx for any replys

Post your as small as possible reproducing script.

I think I release bitmap correctly in my UDF:

Func _SetBitmapToCtrl($CtrlId, $hBitmap)
...
 Local $oldBmp = _SendMessage($hWnd, $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmap)
 If @error Then Return SetError(4, 0, 0)
 If $oldBmp <> 0 Then _WinAPI_DeleteObject($oldBmp)
 Return 1
EndFunc

EDIT:

Look at MSDN about details of STM_SETIMAGE message

http://msdn.microsoft.com/en-us/library/bb760782(VS.85).aspx

EDIT2:

Look at Icons UDF from Yashied

http://www.autoitscript.com/forum/index.php?showtopic=92675

He is using little different approach for releasing stuff when using STM_SETIMAGE in his _SetImage()

Edited by Zedna
Link to comment
Share on other sites

Allright, thanks for the fast reply... heres a reproducing script (i reduced the size already by about 1/20 ^^ its not goin smaller :)

#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile=reproduce_script.exe
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Run_After="ResHacker.exe" -add %out%, %out%, map.bmp, bitmap, map, 0
#AutoIt3Wrapper_Run_After="upx.exe" --best "%out%"
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****

#NoTrayIcon
#include <WinAPI.au3>
#include <GDIPlus.au3>
#include <GuiConstants.au3>

$bTimer = True
_GDIPlus_Startup()

$guiMain = GUICreate("reproducing script", 772, 197)
$guiPicMap = GUICtrlCreatePic("", 0, 0, 772, 197)
GUISetState(@SW_SHOW, $guiMain)

While 1
    If $bTimer = True Then
        $vTimer = TimerInit()
        $bTimer = False
    EndIf

    If TimerDiff($vTimer) >= 2000 Then
        _refresh()
        $bTimer = True
    EndIf
    
    Sleep(10)
    If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
WEnd

Func _refresh()
;get bitmap
    $hInstance = _WinAPI_GetModuleHandle("")
    $hBitmapHandle = _WinAPI_LoadBitmap($hInstance, "map")
    $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBitmapHandle)
    $hGraphic = _GDIPlus_ImageGetGraphicsContext($hBitmap)

;draw something
    $hBrush = _GDIPlus_BrushCreateSolid(0xFF00FF00)
    $hGraphicsFillEllipse = _GDIPlus_GraphicsFillEllipse($hGraphic, 10, 20, 50, 50, $hBrush)

;reverse the handle again for _SetBitmapToCtrl
    $hNewBitmapHandle = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)

;set Bitmap to control
    _SetBitmapToCtrl($guiPicMap, $hNewBitmapHandle)
    
;dispose all stuff
    _GDIPlus_BitmapDispose($hBitmap)
    _WinAPI_DeleteObject($hNewBitmapHandle)
    _WinAPI_DeleteObject($hBitmapHandle)
    _GDIPlus_BrushDispose($hBrush)
EndFunc

Func _SetBitmapToCtrl($CtrlId, $hBitmap); thx to Zedna
    Local Const $STM_SETIMAGE = 0x0172
    Local Const $IMAGE_BITMAP = 0
    Local Const $SS_BITMAP = 0xE
    Local Const $GWL_STYLE = -16

    Local $hWnd = GUICtrlGetHandle($CtrlId)
    If $hWnd = 0 Then Return SetError(1, 0, 0)

    Local $oldStyle = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE)
    If @error Then Return SetError(2, 0, 0)
    _WinAPI_SetWindowLong($hWnd, $GWL_STYLE, BitOR($oldStyle, $SS_BITMAP))
    If @error Then Return SetError(3, 0, 0)

    Local $oldBmp = _SendMessage($hWnd, $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmap)
    If @error Then Return SetError(4, 0, 0)
    If $oldBmp <> 0 Then _WinAPI_DeleteObject($oldBmp)
    Return 1
EndFunc ;==>_SetBitmapToCtrl

i added the map, you need it too, or u use another bitmap with similar size from your own

anyway, u can watch the memory of the process (once u compiled it with reshacker) is goin up all the time. my real script is even much larger and the memory goes up rapidly :party:

hope for help

thanks in advance

edit: ups i just saw ur second edit now.. i'll take a look

map.bmp

Edited by nuki
Link to comment
Share on other sites

Possibly you missed to dispose the hGraphic before deleting the GDI+-bitmap :)

_GDIPlus_GraphicsDispose($hGraphic)

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

lol >.< it works :S the memory stays same... so dear admin (i think u are? ^^) why dont u just put on ur "Next autoit release todo" : Add to helpfile at _GDIPlus_GetGraphicsContext() that it has to be released with _GDIPlus_GraphicsDispose($hGraphic) ! :) it wasnt there but on all other things... so i thought its not necessary to release it -.-

thanks alot ! <3

btw u guys seem to be rly good, cant u tell me if its possible to change the text color of original tray items? (no gui)

heres my thread ^^ maybe u can look at it :party:

http://www.autoitscript.com/forum/index.php?showtopic=95851

Edited by nuki
Link to comment
Share on other sites

  • 2 weeks later...

Zedna

Why this UDF cannot extract resources if i use #AutoIt3Wrapper_Res_File_Add instead #AutoIt3Wrapper_Run_After="ResHacker.exe"?

When i add resources with #AutoIt3Wrapper_Res_File_Add then ResourceHacker determines resources as

RCDATA--> 1 --> 2057

RCDATA--> 2 --> 2057

...

but when i use _ResourceSaveToFile(@ScriptDir & "\resource.dat", "1", $RT_RCDATA, 2057) then resource cannot extract from exe.

ResHacker very very very slowly adds resources in exe

Edited by hunt
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...