>>>>>>>>>>>Hi Gang!
>>>>>>>>>>>
>
>(snip)
>
>>
>>
>>There are a number of restrictions on SetForegroundWindow - see remarks here
https://msdn.microsoft.com/en-us/library/windows/desktop/ms633539(v=vs.85).aspx>>
>>I have this function - try it - don't know whether it will work for you
>>
>>
>>
>>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
>endfunc
>
>
>Using 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).
>
>When I ran this code from TEST program, and allowed a time to hit this code every 3 seconds for testing, the code would run this this new code without error.
>
>When I pressed the NOTEPAD.exe program and made it show OVER part of the TEST program, when the code fired and tried to run the new code (IN the TEST program which was BEHIND the NOTEPAD.exe, the TEST program DID not come to the ForeGround, but rather started to FLASH the TEST icon in the Taskbar.
>
>Not exactly what I was wanting.... (grin).
>
>So..... anything else I can try ???
>
Learn to live with it ?
>Thanks!
Gregory