Version 12 March is online, now with almost 500 commands.
GuiParas equ "Rtf viewer", w700, h600, m0, b none, icon Butterfly ; position, margins, background colour
include \masm32\MasmBasic\Res\MbGui.asm
GetFiles *.as?|*.rtf|*.inc ; load whatever fits your needs
SortFiles name ; could be also date (recent on top) or size (big ones on top)
GuiControl MyList, "listbox", Files$(), x=1000-120, w=0+120 ; leave some space to the right
GuiControl MyEdit, "RichEdit", FileRead$(Files$(0)), bcol RgbCol(120, 120, 120), fcol White, w1000-120, font -14:FW_SEMIBOLD
GuiControl MyStatus, "statusbar", wRec$("Started "+fTime$())
Event Command
.if NotifyCode==LBN_SELCHANGE
SetWin$ hMyEdit=FileRead$(LbSel$) ; load selected file into the RichEdit control
SetStatus$ Cat$("Current file: "+LbSel$+Str$(", %i bytes", LastFileSize)+", created "+GfDate$(-1))
.endif
GuiEndAmong the improvements is the option to give a foreground colour also to a RichEdit control (see attached source and exe):
GuiControl MyEdit, "RichEdit", FileRead$(Files$(0)), bcol RgbCol(120, 120, 120), fcol White,This is a tricky business, because it works fine with a plain text file loaded into the RichEdit control, but what about RTF files? They have their own text colours stored in the file, but they don't have a background colour unless you explicitly apply it in your RTF editor, such as
RichMasm or WordPad.
So what happens is that you tell the control "I want white text on dark background", and that works fine for plain text, but if you load a RTF file, you are stuck with the text colours chosen by the file's author. Which might be, ehm, black...

Btw the RichEdit control checks automagically if an MS Office versions of RichEd20.dll is installed on your machine. If so, it loads RTF files a factor 20-30 faster than the standard RichEd20 in Windows\System32. That doesn't matter if your files are tiny, but when they approach the megabyte range, it surely makes a big difference. The RichMasm source, for example, with 1.4 MB, loads in less than a second on my trusty old Core i5.
You don't need MS Office to get the fast DLLs: the old
Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint installs them for free. Same for the
Word viewer, I suppose.
Test it yourself: Extract the exe to a folder that has both *.rtf (or *.asc) files and plain text, such as *.asm and *.inc.