Open gz-95 opened 2 months ago
I don't have a windows machine handy. Do you know which specific windows API is blocked?
In my testing, it appears that IModalWindow::Show
continues to block until active user interaction even though a successful call to IFileDialog::Close
has returned.
I'm starting to wonder if this is just the way these Windows functions are implemented?
Also, it looks like dialogHookProc
never gets called even with a successful SetWindowsHookEx
registration. That explained why I wasn't seeing this line firing.
Thanks for the detailed report. Yeah, I'm not seeing a way out of this…
Agreed. I've ditched IFileDialog::Close
because I'm convinced that it was only ever intended to be called inside IFileDialogEvents
callbacks.
Workaround: if I call CoInitializeEx
with COINIT_APARTMENTTHREADED
, somehow SetWindowsHookEx
seems to work again for the dialogs. So I went with that and just call PostMessage(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0)
when the context expires.
This was put in place because of #89. I'm a bit reluctant to go back on that.
Thanks for this really helpful library! Just having some trouble with closing the dialogs programmatically.
It seems that when the context is canceled, the dialog remains open until the user interacts with it e.g. navigating different directories etc. Here's an example code that reproduces the issue on Windows 10.0.19045 Build 19045
Basically, the call to
zenity.SelectFile
is blocked with no way of returning even if the context has expired unless the user is actively interacting with the underlying dialog.