force run script as unicode 32 Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
smarq8
Posts: 69
Joined: 16 Jan 2016, 00:33

force run script as unicode 32

17 Sep 2019, 11:09

Hello.
Is it possible to force some script to run always as U32? By default I use U64 but I also use once of my older script that is U32 compatile only because of some DLL functions and I want to force somehow this script to run always as U32 independently of my current settings. Any tips?
gregster
Posts: 9064
Joined: 30 Sep 2013, 06:48

Re: force run script as unicode 32

17 Sep 2019, 11:23

Either compile your script with the unicode 32 bit base file and run the the exe-file - you can choose it in the options when you run the ahk2exe compiler (included with AHK) - or use this, if you want, for example, to change the ahk-file from time to time without the need to re-compile:
https://www.autohotkey.com/docs/Scripts.htm#cmd wrote: if you rename AutoHotkey.exe to MyScript.exe, it will attempt to find MyScript.ahk
That means, make a copy of AutoHotkeyU32.exe from the AutoHotkey folder, copy it to your script's folder and rename it, so that it will run your ahk-script, when you run the exe:
MyScript.ahk --> rename AutoHotkeyU32.exe to MyScript.exe --> run Myscript.exe (which will run MyScript.ahk automatically without further parameters

(Or perhaps use a specific file extension for unicode 32 bit files that you then register with AutoHotkeyU32.exe)
Odlanir
Posts: 659
Joined: 20 Oct 2016, 08:20

Re: force run script as unicode 32  Topic is solved

17 Sep 2019, 11:30

I use this method when I need to run in 32bit mode, putting the following to the top of the script:

Code: Select all

if (A_Args.Length() = 0) {
   Run, "C:\Program Files\AutoHotkey\AutoHotkeyU32.exe" %A_ScriptFullPath% 1
   ExitApp
}
Please note then A_Args require at least the version v1.1.27.
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode
smarq8
Posts: 69
Joined: 16 Jan 2016, 00:33

Re: force run script as unicode 32

17 Sep 2019, 11:54

@Odlanir
Brilliant :dance:
thanks

PS i just mod this to that for own purposes
if(A_IsUnicode!=1 || A_PtrSize!=4)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: peter_ahk, Rohwedder and 157 guests