HostDialog.WaitDialogClose Issue
Posted: Tue Feb 14, 2023 7:50 am
There is something wrong with this function(Win10).
1,ctrl+o open file broswer
2, on file type, selelct "All Files(*.*)"
3, select a txt file(any one) and open the converter dialog window,
4, select "UTF8 Text" converter
the BB will hang!
the patch is: WinApi.Sleep(1) is to reduce the high CPU load when openning the converter dialog.
1,ctrl+o open file broswer
2, on file type, selelct "All Files(*.*)"
3, select a txt file(any one) and open the converter dialog window,
4, select "UTF8 Text" converter
the BB will hang!
the patch is:
Code: Select all
PROCEDURE WaitDialogClose;
VAR res: INTEGER; w: HostWindows.Window; msg: WinApi.MSG;
BEGIN
w := HostWindows.dir.First();
REPEAT
IF WinApi.PeekMessageW(msg, 0, 0, 0, 1) # 0 THEN
(*IF (msg.hwnd = w.wnd) OR (msg.message = WinApi.WM_PAINT) THEN*)
res := WinApi.TranslateMessage(msg);
res := WinApi.DispatchMessageW(msg)
(*END*)
ELSE WinApi.Sleep(1);
END;
UNTIL w.wnd = 0;
END WaitDialogClose;