Hi.
Somehow the seccess of this procedure depends on where was the last mouse-click on the form.
Thank God my ultimate judges - the users decided they want the calculator minimized. So ThisForm.windowstate=1 was enough.
Thanks for the answer.
Kamil
>If the called window's application is in foreground then this should work:
>
>* API Declarations
>Declare Integer GetActiveWindow In Win32API
>Declare Integer GetWindow In Win32API Integer HWnd, Integer dflag
>Declare integer SetActiveWindow in win32API integer hWnd
>
>#define GW_HWNDNEXT 2
>#define GW_HWNDPREV 3
>
>SetActiveWindow(GetWindow(GetActiveWindow(), GW_HWNDPREV))
>Clear Dlls 'GetActiveWindow','GetWindow','SetActiveWindow'
>
Cetin
A moment of silence is our cosmic reset button.