Very good catch Shardik
Now it works with PB 5.61 as well
Thanks
Code: Select all
OpenWindow(0,200,200,500,170,
"EditorGadget with DOS Graphics characters in Unicode mode")
EditorGadget(0,10,10,480,150,#PB_Editor_WordWrap)
dir$=Chr(34)+"C:\Program Files\Internet Explorer"+Chr(34)
flags=#PB_Program_Hide|#PB_Program_Open|#PB_Program_Read
p=RunProgram(GetEnvironmentVariable("comspec"),"/c tree "+dir$,"",flags)
While ProgramRunning(p)
If AvailableProgramOutput(p)
o$+ReadProgramString(p, #PB_Ascii)+"\par"
EndIf
Wend
a$ = "{\rtf1\ansi\ansicpg1252\deff0\deflang3082{\fonttbl" +
"{\f0\fmodern\fcharset254 Terminal}}\fs32" + o$ + "}"
b$ = Space(StringByteLength(a$, #PB_Ascii) + 1)
PokeS(@b$, a$, -1, #PB_Ascii)
SendMessage_(GadgetID(0), #WM_SETTEXT, 0, @b$)
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow