HostDialog.WaitDialogClose Issue

Post Reply
Posts: 87
Joined: Thu Dec 17, 2015 1:32 pm

HostDialog.WaitDialogClose Issue

Post by luowy »

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:

Code: Select all

	PROCEDURE WaitDialogClose;
		VAR res: INTEGER; w: HostWindows.Window; msg: WinApi.MSG;
		w := HostWindows.dir.First();
			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)
			ELSE WinApi.Sleep(1);
		UNTIL w.wnd = 0;
	END WaitDialogClose;
WinApi.Sleep(1) is to reduce the high CPU load when openning the converter dialog.
Post Reply