you'll need pywin32, but don't download using pip install pywin32
download from https://github.com/mhammond/pywin32/releases
OR ELSE IT WON'T WORK for AutoHotkeyU64.exe, it will only work for AutoHotkeyU32.exe.
make sure to download amd64, (I downloaded pywin32-300.win-amd64-py3.8.exe)
EDIT: now I understand why it didn't work
I think it CAN work when using pip install pywin32 if you register it correctly.
you have 2 choices:
- register it correctly as shown here How to program hotstrings in python like in autohotkey :
do NOT use UseCommandLine(), use RegisterServer(clsctx=pythoncom.CLSCTX_LOCAL_SERVER, ...)
- after server has been registed using
UseCommandLine(), delete the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{C70F3BF7-2947-4F87-B31E-9F5B8B13D24F}\PythonCOMPath\InprocServer32
replace {C70F3BF7-2947-4F87-B31E-9F5B8B13D24F} with your own CLSID
(I think) there is no need for
key: InprocServer32:
Name : (Default)
Type : REG_EXPAND_SZ
Data : pythoncom39.dll,
also, requiring it makes it fail
(I think) There's no need because it actually uses LocalServer32 (which is also a key)
mine is:
Name : (Default)
Type : REG_SZ
Data : C:\PROGRA~3\Miniconda3\pythonw.exe "C:\ProgramData\Miniconda3\lib\site-packages\win32com\server\localserver.py" {C70F3BF7-2947-4F87-B31E-9F5B8B13D24F}
localserver.py is the one doing the COM stuff, to prove it, replace pythonw with python. you will the window when it's ran.