HostDialog.WaitDialogClose Issue

Post Reply
luowy
Posts: 88
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;
	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;
WinApi.Sleep(1) is to reduce the high CPU load when openning the converter dialog.
Post Reply