You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
python 64-bit: x64w/AutoHotkey.dll or AutoHotkeyMini.dll
python 64-bit: Win32w/AutoHotkey.dll or AutoHotkeyMini.dll
btw, 64-bit dll seems occur an crash while using ahkgetvar
main.py
#! python3importctypesimporttimeimportsysimportpathlibimporttypingdll_file_path=str(
pathlib.Path(__file__).parent/f'AutoHotkey{sys.hash_info.width}.dll')
ahk_instance=ctypes.cdll.LoadLibrary(dll_file_path)
ahk_instance=ctypes.CDLL(dll_file_path)
ahk_instance.ahktextdll("")
whilenotahk_instance.ahkReady():
time.sleep(0.1)
defgoahk(code: str):
"""run source code with autohotkey."""returnahk_instance.ahkExec(code)
defgetahk(var_name: str):
"""get var value from ahk script by var name"""result=ahk_instance.ahkgetvar(var_name, 0)
result=ctypes.cast(result, ctypes.c_wchar_p)
returnresult.value__all__= ['goahk', 'getahk']
deftest():
goahk(u'''msgbox Hello World;var_name=sss ''')
print(getahk('var_name'), flush=1)
if__name__=="__main__":
test()
I put the dll file in the dir of main.py
using 32-bit python.exe will run success => show msgbox and print sss
using 32-bit python.exe will run failed=> show msgbox and exited with code=3221225477
sorry for my stupid English grammar...
The text was updated successfully, but these errors were encountered:
dll file can be upload to pypi, and I found an issue while call 64bit AutoHotkey.dll,
will this
ahk
lib support dll file path arg?Download URL:
https://github.com/HotKeyIt/ahkdll-v1-release/
python 64-bit: x64w/AutoHotkey.dll or AutoHotkeyMini.dll
python 64-bit: Win32w/AutoHotkey.dll or AutoHotkeyMini.dll
btw, 64-bit dll seems occur an crash while using
ahkgetvar
I put the dll file in the dir of main.py
using 32-bit python.exe will run success => show msgbox and print sss
using 32-bit python.exe will run failed=> show msgbox and exited with code=3221225477
sorry for my stupid English grammar...
The text was updated successfully, but these errors were encountered: