oForm=CREATEOBJECT("MyTextEditor",GETFILE(),"Watching this file",2) oForm.SHow(1) DEFINE CLASS myTextEditor as _showtext OF (HOME(1)+"ffc\_reports.vcx") PROCEDURE INIT LPARAMETERS tcSourceFile,; && Path of the file tcCaption,; && Title of the Windo tnWindowState && Normal = 0, Minimized = 1 , Maximized =2 DODEFAULT(tcSourceFile) WITH This .Caption = IIF(VARTYPE(tcCaption)='C' AND !EMPTY(tcCaption),tcCaption,"Text Viewer") .WindowState=IIF(VARTYPE(tnWindowState)='N' AND INLIST(tnWindowState,0,1,2),tnWindowState,0) ENDWITH ENDPROC PROCEDURE Activate This.Resize() DODEFAULT() ENDPROC ENDDEFINEHTH
LOCAL lcFile lcFile = THIS.txtResults.Value IF !EMPTY(lcFile) AND FILE(lcFile) AND UPPER(JUSTEXT(lcFile)) == "TXT" lcFile = "notepad " + lcFile RUN &lcFile ENDIF>However, when the above code is run you get the text file opened in notepad but you can see a DOS window in the background until you close the file. Is there any way you can do this without showing the DOS window?