Jump to content

Recommended Posts

  • 3 weeks later...
  • 4 weeks later...
Posted (edited)

Well, nearly a year since I last replied...

@Yashied, That was the only thing I was going to post about today but find it's already fixed - thanks for that!

@Melba23, Thanks again for the improvements...

@WebRaider, use Eval() to build variable names on-the-fly and have them evaluated/substituted at once e.g:

Local $myvar = "Hello World!"
ConsoleWrite(Eval("my" & "var") & @CRLF) ; Outputs "Hello World!" to STDOUT

So _ResourceSetImageToCtrl($Block[$bCountX][$bCountY],Eval(Picture[$rd])) should work.... never tried it but I def. will have to one day.

@leuce, it can easily do what you want although nothing stops other users from exploring your EXE with ResHacker to take the file! If that's a concern you could write custom (de)obfuscation or (d)ecryption code, and/or pack the Gold release with something better than UPX.

@Zedna, my miniature idol embued with your glorious brilliance in mad skripting skillz sends his regards.

Edited by DanielC
  • 4 weeks later...
Posted (edited)

  On 10/19/2009 at 11:53 AM, 'jfitty said:

does anyone have any examples of how to add a .exe file as a resource??

There is a solution for executing EXE directly from memory (or resources) but it's not simple.

Look at "Run binary (executing from memory)" example from trancexx

http://www.autoitscript.com/forum/index....owtopic=99412&st=0&p=713513&#entry713513

Just to be complete, there is also solution for calling DLL functions from memrory (or resources)

Embed DLLs in script and call functions from memory - Pure AutoIt script (Now worked under Vista) from Ward

#560708

***

Later I will add these links also to my first post.

EDIT: fixed broken links

Edited by Zedna
  • 4 weeks later...
Posted

All,

I'm having a problem with a script I'm currently writing and so I was hoping someone here could help.

I have GIF resource, which must be a GIF due to transparency (no, I'm not messing with PNG):

#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, res\tweetBird.gif, rcdata, TWEET_GIF_1, 0

I'm also using a slightly modified version of Melba23's Toast UDF. I changed line 406:

If $iIcon_Reduction Then GUICtrlCreateIcon($sDLL, $iIcon_Style, 10, 10 + $iTitle_Height)

to:

If $iIcon_Reduction Then GUICtrlCreatePic($iIcon_Style, 10, 10 + $iTitle_Height)

So that I could use the GIF resource.

For my script I also made a little function to prep and create the toast window:

Func _Toast($ioMsg)
    Local $aColor[3] = [0x97D9F5, 0xe9eff5, False]
    _Toast_Set(0, $aColor, 0x000000, 0xe9eff5, 0x000000, 11, "Arial")
    $aRet = _Toast_Show(_ResourceGet("TWEET_GIF_1"), $strAppName, $ioMsg, 5)
    _Toast_Hide()
EndFunc

My problem is setting the icon in the _Toast_Show() function. I've tried all different combinations trying to get the data from the resource into the control but alas no luck.

So, could anyone please show me how to get the image file into the picture control without using _ResourceSetImageToCtrl() as that would require more editing of the Toast UDF.

Thanks,

James

  • Moderators
Posted

James,

Pop over to the Toast topic and I have a solution for you with only a very slight modification to the Toast UDF itself - which does not break any other Toast functionality.

It does use _ResourceSetImageToCtrl from Zedna's Resources UDF, but I am not reinventing that particular wheel today!

Hope to see you there! :D

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:

  Reveal hidden contents

 

Posted (edited)

Melba,

Thank you very much for taking the time to add this! I was hoping there would have been a simpler way, but as it's fixed, thanks!

Edit: Where is the solution? Or is it not posted quite yet? If I know I must use the SetImageToCtrl() function, I could probably go about this myself.

James

Edited by JamesBrooks
Posted (edited)

Been trying to use this UDF for awhile, but i can't seem to get it to work. But i don't think there's any problem with my code. cause not even the examples runs. Probably missed something.

To run the examples. Iv'e downloaded and extracted the resource files, the data files. And compiled using SciTE4AutoIt3. Any one that know what i've could missed?

EDIT: Spelling

Edited by PhilipG
Posted (edited)

  On 2/2/2010 at 3:09 PM, 'PhilipG said:

Been trying to use this UDF for awhile, but i can't seem to get it to work. But i don't think there's any problem with my code. cause not even the examples runs. Probably missed something.

To run the examples. Iv'e downloaded and extracted the resource files, the data files. And compiled using SciTE4AutoIt3. Any one that know what i've could missed?

Reread whole first post, especially

Notes:

* to compile all script examples you must have installed Scite4AutoIt3 also with reshacker.exe/upx.exe in "Windows search path" or script directory -> you must compile script by F7 from full Scite

...

Also what Autoit/Scite4Autoit3 version do you have?

What OS? I didn't test my UDF on Vista or Win7

Firstly try minimal example resource_test_min1.au3

Edited by Zedna
Posted

  On 2/2/2010 at 3:51 PM, 'Zedna said:

Reread whole first post, especially

Notes:

* to compile all script examples you must have installed Scite4AutoIt3 also with reshacker.exe/upx.exe in "Windows search path" or script directory -> you must compile script by F7 from full Scite

...

Also what Autoit/Scite4Autoit3 version do you have?

What OS? I didn't test my UDF on Vista or Win7

Firstly try minimal example resource_test_min1.au3

I tried that small one. But i think i'm missing Reshacker, where do i find it?

Posted (edited)

  On 2/2/2010 at 4:01 PM, 'PhilipG said:

i found reshacker and placed it in the script dir. Still not working though...

I'm using win xp. autoit v3.3.0.0

Try to put reshacker to directory which is included in "Windows search path"

or into Autoit3Wrapper directory:

"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\"

Edited by Zedna
Posted

Go grab the new AutoIt3Wrapper beta if you can't figure out ResHacker. I've worked with Jos to majorly upgrade the resource addition capabilities of AutoIt3Wrapper so ResHacker is not needed.

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
  • Recently Browsing   0 members

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