local DN = {}
for k,v in pairs(far.Flags) do
if k:sub(1,3)=="DN_" then
DN[v] = k
end
end
local function Progress(text,title)
local len = math.max(10,text:len()+2)
local items = {
--[[01]] {F.DI_SINGLEBOX,0,0,len,4,0,0,0,0,title},
--[[02]] {F.DI_TEXT, 1,1,0,0,0,0,0,0,text},
}
local flags = nonmodal and F.FDLG_NONMODAL
local function DlgProc(hDlg,Msg,Param1,Param2)
win.OutputDebugString(DN[Msg] or Msg)
win.OutputDebugString(hDlg)
if Msg==F.DN_INITDIALOG then
--hDlg:send("DM_SETTEXT",2,"hello") --!!ERROR
end
end
return far.DialogInit(id,-1,-1,len,4,len,items,flags, DlgProc)
end

local hDlg = Progress(" ")
if nonmodal then return end
far.DialogRun(hDlg)
far.DialogFree(hDlg)