Page 1 of 1

FileSelectFile not working with AHK_H

Posted: 06 Dec 2021, 16:44
by dd900
Latest 64bit & 32bit Unicode AHK_H v1

This causes AHK_H to hang indefinitely.
FileSelectFile, exe, 3,, Select Executable, Exe Files (*.exe)

I've also tried SKAN's FileSelectFile()
which gives the same result.

Edit 1:
DllCalls to comdlg32.dll\GetSaveFileName and comdlg32.dll\GetOpenFileName seem to be where the issue is happening using SKAN's function.

Edit 2:
Still trying.
I've created a dll in C# with exported functions. I used OpenFileDialog from System.Windows.Forms instead of Microsoft.Win32. The dll works as expected with AHK_L, but I'm still getting the same hanging issue when trying to open a file using AHK_H.
Ahk Code
C# Code

Edit 3:
This is still happening. It stopped for about three days and everything worked fine. Now it is back to hanging every time I try to open a file. I can hear an error noise but there is no popup or messagebox anywhere.

Re: FileSelectFile not working with AHK_H

Posted: 14 Aug 2023, 18:32
by keylo
From the manual:>> Known limitation: A timer that launches during the display of a FileSelectFile dialog will postpone the effect of the user's clicks inside the dialog until after the timer finishes. To work around this, avoid using timers whose subroutines take a long time to finish, or disable all timers during the dialog:

Thread, NoTimers
sleep,500
FileSelectFile, OutputVar
Thread, NoTimers, false