Upcoming Ahk2Exe changes

Community news and information about new or upcoming versions of AutoHotkey
TAC109
Posts: 1098
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe changes

Post by TAC109 » 22 Jun 2020, 05:06

At this stage I plan to just fix the error in that line of code so that it works with v2, and also use Util_TempFile() to get the work file, rather than more extensive changes, if that’s ok @lexikos.

Edit: I don’t think AHKType() would work here.
Edit2: as AHKType() doesn’t return the equivalent of IsUnicode.

@TheArkive - I should have a Beta ready for you soon. (I’ll post it in the other thread in 'Scripts and Functions'.)
Cheers
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe

User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Upcoming Ahk2Exe changes

Post by TheArkive » 22 Jun 2020, 05:24

TAC109 wrote:
22 Jun 2020, 05:06
At this stage I plan to just fix the error in that line of code so that it works with v2, and also use Util_TempFile() to get the work file, rather than more extensive changes, if that’s ok @lexikos.

Edit: I don’t think AHKType() would work here.
Edit2: as AHKType() doesn’t return the equivalent of IsUnicode.

@TheArkive - I should have a Beta ready for you soon. (I’ll post it in the other thread in 'Scripts and Functions'.)
Cheers
That works! As far as I can tell Ahk2Exe still works just fine, as long as the user matches the appropriate bin with the appropriate version of a script. I'm personally not in a hurry. Just trying to help.

lexikos
Posts: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Re: Upcoming Ahk2Exe changes

Post by lexikos » 23 Jun 2020, 06:26

TAC109 wrote:
22 Jun 2020, 05:06
Edit: I don’t think AHKType() would work here.
Edit2: as AHKType() doesn’t return the equivalent of IsUnicode.
It would and it does, but the result is based on the file version string, which is blank for AutoHotkeySC.bin. Since we're talking about checking the version of AutoHotkey.exe, that's not a problem.

A more reliable means of detecting whether an AutoHotkey binary file is Unicode is to scan it for a specific string.

julesverne
Posts: 42
Joined: 18 Apr 2017, 14:39
Contact:

Re: Upcoming Ahk2Exe changes

Post by julesverne » 16 Nov 2020, 15:27

I just wanted to alert all about a very odd bug with ahk_H vers 1 ahk2exe that was solved by @TheArkive

Bug: AutoHotKey icon showing for compiled script that should be user defined icon.

When compiling your script and choosing the option to include a user defined icon, you will see the icon in the taskbar when running the output exe but the file in Explorer will show the AHK icon. It seems that @TheArkive figured out that if you simply move the exe to a different location you will see the icon.

Weird bug, but his solution worked for me. Thanks @TheArkive

*edit*
Even weirder is that when you move the exe back to where it was compiled, the icon goes back to being the autohotkey icon.

TAC109
Posts: 1098
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe changes

Post by TAC109 » 16 Nov 2020, 17:05

This thread is not about the Ahk2Exe version that ships with AutoHotkey_H, but is an old thread relating to Ahk2Exe for standard versions of AutoHotkey. This old thread has been superseded by this thread, and the changes mentioned have been incorporated into AutoHotkey version 1.1.33.00 and later.

Any problems you have with the AutoHotkey_H version of Ahk2Exe you should post in the AutoHotkey_H section of the forum.

Cheers
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe

julesverne
Posts: 42
Joined: 18 Apr 2017, 14:39
Contact:

Re: Upcoming Ahk2Exe changes

Post by julesverne » 16 Nov 2020, 18:27

Thanks @TAC109

User avatar
hecore
Posts: 9
Joined: 22 May 2019, 16:38

Re: Upcoming Ahk2Exe changes

Post by hecore » 17 Mar 2021, 09:57

How to use multiply icons?

This dont working

Code: Select all

;@Ahk2Exe-SetMainIcon 1.ico
;@Ahk2Exe-AddResource 2.ico
;@Ahk2Exe-AddResource 3.ico

a::
  Menu, Tray, Icon, 2.ico
  
b::
  Menu, Tray, Icon, 3.ico
 
thanx

User avatar
boiler
Posts: 16767
Joined: 21 Dec 2014, 02:44

Re: Upcoming Ahk2Exe changes

Post by boiler » 17 Mar 2021, 12:05

Are you seeing it change only to 3.ico no matter which hotkey you press? That's because you don't have a return at the end of your hotkey routines, which would cause the first one to "fall through" and execute the second one as well when you press the first hotkey. The return isn't necessary only when it's a single command on the same line as the hotkey label. So it can be either:

Code: Select all

a::
  Menu, Tray, Icon, 2.ico
return
  
b::
  Menu, Tray, Icon, 3.ico
return
or:

Code: Select all

a::Menu, Tray, Icon, 2.ico
  
b::Menu, Tray, Icon, 3.ico

Post Reply

Return to “Announcements”