Upcoming Ahk2Exe changes

Community news and information about new or upcoming versions of AutoHotkey
User avatar
joedf
Posts: 5250
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: Upcoming Ahk2Exe changes

18 Jul 2015, 12:36

The FileInstall that is never executed is just an old trick. you no longer to use that because of the directives :)
tmplinshi
Posts: 1049
Joined: 01 Oct 2013, 14:57

Re: Upcoming Ahk2Exe changes

18 Jul 2015, 21:22

2. Do i still need to use ;@Ahk2Exe-AddResource SNAP.wav ?

No.
3. Should the function call "PlaySound ( Sound)" be used to play the sound instead of "SoundPlay" ?

Yes.
4. Shouldn't "FileInstall, SNAP.wav, - " be in the autoexec section at the top of my code along with "ResRead( Sound, "SNAP.wav" )" ?

No. If you put into autoexec section, then the file will be extracted.
If you want to put in autoexec section, use this instead:
Skrell
Posts: 163
Joined: 23 Jan 2014, 12:05

Re: Upcoming Ahk2Exe changes

18 Jul 2015, 22:37

Ok so i got the script playing sounds from the autoexec section; however, when i use PlaySound (SoundRef) in the "hotkey" section they NEVER play. Also this ONLY works in XP sound wise and not in 8.1 at all (no sounds are played in ANY section) even though i do see win 8.1 has the winmm.dll . Any thoughts ?
tmplinshi
Posts: 1049
Joined: 01 Oct 2013, 14:57

Re: Upcoming Ahk2Exe changes

18 Jul 2015, 23:18

Skrell wrote:when i use PlaySound (SoundRef) in the "hotkey" section they NEVER play

Make sure you have executed ResRead( Sound, "test.wav" ) before PlaySound.
Skrell
Posts: 163
Joined: 23 Jan 2014, 12:05

Re: Upcoming Ahk2Exe changes

19 Jul 2015, 12:00

Here try this:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

HotKeyIt
Posts: 1232
Joined: 29 Sep 2013, 18:35
Contact:

Re: Upcoming Ahk2Exe changes

19 Jul 2015, 15:01

Code: [Select all] [Download] GeSHi © Codebox Plus

ResRead(tada, "C:\Windows\Media\tada.wav")
Skrell
Posts: 163
Joined: 23 Jan 2014, 12:05

Re: Upcoming Ahk2Exe changes

19 Jul 2015, 15:32

HotKeyIt wrote:

Code: [Select all] [Download] GeSHi © Codebox Plus

ResRead(tada, "C:\Windows\Media\tada.wav")

I'm trying to execute the wav from within the compiled executable that's why I did that. There should be a fileinstall function in my code which is supposed to build the wav into the executable then I'm trying to make a reference to it so that I can play it with PlaySound.
HotKeyIt
Posts: 1232
Joined: 29 Sep 2013, 18:35
Contact:

Re: Upcoming Ahk2Exe changes

19 Jul 2015, 16:07

The recource will be called the same as FileInstall, so you cannot use "tada.wav", you will need the full path
Skrell
Posts: 163
Joined: 23 Jan 2014, 12:05

Re: Upcoming Ahk2Exe changes

19 Jul 2015, 16:14

HotKeyIt wrote:The recource will be called the same as FileInstall, so you cannot use "tada.wav", you will need the full path

Omg.... I had no idea!! I'll try that asap!
Did you get it working with my hotkey code and your adjustment?

*UPDATE* this still does NOT work for a compiled executable. Please try it for yourself.
what version of windows and what version of the ahk2exe compiler are you using ? Is there some flag or something i need to set for the compiler?
I've tried it now on both win7 and win8.1 PCs and neither work for the compiled version. There is definitely some small thing i'm missing here.
Skrell
Posts: 163
Joined: 23 Jan 2014, 12:05

Re: Upcoming Ahk2Exe changes

20 Jul 2015, 21:11

Found the problem btw! The ResRead function does NOT work with 64bit OSes!
tmplinshi
Posts: 1049
Joined: 01 Oct 2013, 14:57

Re: Upcoming Ahk2Exe changes

29 Aug 2015, 22:48

Hope it will support to adding resources to other Resource Type.
Syntax:

Code: [Select all] [Download] GeSHi © Codebox Plus

;@Ahk2Exe-AddResourceEx [File], [Resource Type], [Resource ID]

Example usage:

Code: [Select all] [Download] GeSHi © Codebox Plus

;@Ahk2Exe-AddResourceEx image\test.gif, GIF, 110
;@Ahk2Exe-AddResourceEx image\test.png, PNG, 456
Attachments
2015-08-30_114428.png
2015-08-30_114428.png (3.89 KiB) Viewed 7509 times
tmplinshi
Posts: 1049
Joined: 01 Oct 2013, 14:57

Re: Upcoming Ahk2Exe changes

01 Sep 2015, 02:41

tmplinshi wrote:Hope it will support to adding resources to other Resource Type.
Syntax:

Code: [Select all] [Download] GeSHi © Codebox Plus

;@Ahk2Exe-AddResourceEx [File], [Resource Type], [Resource ID]

Example usage:

Code: [Select all] [Download] GeSHi © Codebox Plus

;@Ahk2Exe-AddResourceEx image\test.gif, GIF, 110
;@Ahk2Exe-AddResourceEx image\test.png, PNG, 456

It already supported! :mrgreen:

Code: [Select all] [Download] GeSHi © Codebox Plus

;@Ahk2Exe-AddResource *GIF image\gif.gif, 110
;@Ahk2Exe-AddResource *PNG image\gif.gif, 456
Peter2
Posts: 208
Joined: 21 Sep 2014, 14:38
Location: CH
Contact:

Re: Upcoming Ahk2Exe changes

26 Sep 2015, 17:33

Hi

what's the current state of this project?

The link in the first post is from January, the latest changes at Github are from August. The help at http://fincs.ahk4.net/Ahk2ExeDirectives.htm says "only BMP and DIB" as resource, the posting above says "also GIF and PNG" ....

Please update us with current information :idea: ;)
Peter (AHK Beginner) / Win 7 x64, AHK Version v1.1.22.xx
Teemu
Posts: 3
Joined: 28 Nov 2015, 17:10

Re: Upcoming Ahk2Exe changes

28 Nov 2015, 17:20

If I compile my autohotkey script to exe, will it work at every computer?
User avatar
joedf
Posts: 5250
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: Upcoming Ahk2Exe changes

29 Nov 2015, 08:04

It should.
Bruttosozialprodukt
Posts: 447
Joined: 24 Jan 2014, 22:28

Re: Upcoming Ahk2Exe changes

29 Nov 2015, 09:09

Well.. more or less. Obviously it would only run under Windows.
And I think AHK_L dropped official support for everything prior to XP at some point.
And if you compile it as 64bit, it won't run on 32bit computers.
haichen
Posts: 129
Joined: 09 Feb 2014, 08:24

Re: Upcoming Ahk2Exe changes

30 Nov 2015, 07:57

I want get the text from the html resource of the compiled script.

Code: [Select all] [Download] GeSHi © Codebox Plus

;@Ahk2Exe-AddResource  test.html
;compiled to test.exe

I was able to get it from another script with

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



but i want it from the same exe. Like the Sound.wave Example
I tried this, but there seems to be something wrong

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Thanks for advice
haichen
Posts: 129
Joined: 09 Feb 2014, 08:24

Re: Upcoming Ahk2Exe changes

30 Nov 2015, 12:34

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



This works!
Edit: The former function only worked with X32.
This ResRead() read Textresources also with X64 Autohotkey.
haichen
Posts: 129
Joined: 09 Feb 2014, 08:24

Re: Upcoming Ahk2Exe changes

02 Dec 2015, 12:44

I changed the above function to work with X32 and X64 Autohotkey.

I think it would be nice to integrate something like this in AHK2exe and add a Varname to the resource directive. So it will be very easy to access a embedded resource like text, html, images, sound and others.
haichen
Posts: 129
Joined: 09 Feb 2014, 08:24

Re: Upcoming Ahk2Exe changes

09 Dec 2015, 03:06

I combined the example from tmplinshi with mine from above to get text and binary resources with one function.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Return to “Announcements”

Who is online

Users browsing this forum: No registered users and 2 guests