>function WindowToForeGround(handle) > =ShowWindow(m.Handle, SW_SHOW) > if( empty(SetForegroundWindow(m.handle)) ) > =ShowWindow(m.handle, SW_SHOWMINIMIZED) > =ShowWindow(m.handle, SW_RESTORE) > endif >endfunc >Here is the code I was using based on your code...
Function WindowToForeGround LPARAMETERS handle * Constants used with APIs #DEFINE SW_SHOW 5 #DEFINE SW_RESTORE 9 #DEFINE SW_SHOWMINIMIZED 2 DECLARE INTEGER SetForegroundWindow IN user32 INTEGER hwnd Declare Long ShowWindow In Win32API Long, Long =ShowWindow(Handle, SW_SHOW) FORM1.TXTOUTPUT.VALUE = form1.txtoutput.value + CHR(32) + 'Attempted the showwindow before the if endif' WAIT WINDOW "" TIMEOUT 3 if( empty(SetForegroundWindow(handle)) ) =ShowWindow(handle, SW_SHOWMINIMIZED) =ShowWindow(handle, SW_RESTORE) FORM1.TXTOUTPUT.VALUE = form1.txtoutput.value + CHR(32) + 'wE are in the foreground3 code in the if endif' WAIT WINDOW "" TIMEOUT 3 endif endfuncUsing this, I was able to see output directed to an output text window (which had no affect, since the behavior was the same with or without it).