oHide = CreateObject('MyTimer') oHide.cTitle = 'Preview' oHide.Enabled = .T. Report form MyForm preview oHide = Null Release oHide Clear all Define Class MyTimer as Timer #DEFINE SWP_NoSize 0x0001 #DEFINE SWP_NoMove 0x0002 #DEFINE SWP_HideWindow 0x0080 #DEFINE SWP_None SWP_NoSize+SWP_NoMove+SWP_HideWindow #DEFINE VFP_Preview 'Print Preview' Interval = 48 Enabled = .F. cTitle = '' Procedure Init * You can download this from UT download area * or change this with FindWindow / FindWindowEx Declare Long FindWTitle in HTWindow ; String @cTitle, Integer nCase, Integer nShow Declare Short SetWindowPos in User32 as SetWinPos ; Long hwnd, Long hWndInsertAfter, ; Integer nHorz, Integer nVert, Integer nWidth, Integer nHeight, Long nFlags EndProc Procedure Timer Local ln_hWnd, lc_Title * If WVisible(VFP_Preview) * Hide window VFP_Preview * endif lc_Title = This.cTitle + replicate(chr(0), 64) ln_hWnd = FindWTitle(lc_Title, 1, 0) If (ln_hWnd != 0) This.Enabled = .F. SetWinPos(ln_hWnd, 0, 0, 0, 0, 0, SWP_None) endif EndProc Procedure Destroy Clear Dlls FindWTitle, SetWinPos EndProc EndDefine