>I've followed your advice to use the following:
>
>DECLARE INTEGER GetActiveWindow IN WIN32API
>DECLARE INTEGER ShowWindow IN WIN32API INTEGER hWnd, INTEGER ShowWindowMode
>=ShowWindow(GetActiveWindow(),5)
>
>I put the above statements in the Init method of the form but I still could not see my expected application appear as the top most window.
>
>I have 2 applications called server1.exe and client.exe. The client.exe uses timer to check whether there is a signal (via DBF file) from the server1.exe to release current form (process form) and launch another form (lock form).
>
>I click on the server1.exe to trigger the launch the Lock form, the Lock form load behind and not as the foremost window. Why?
>
Probably because the hWnd returned by GetActiveWindow() is not that of your application - you have to save the hWnd at a time where your windows is active and use it. There are entries in the FAQ that may be helpful, but I'm afraid that more detailed exploration on my part would involve billable time, and should not be done through a mechanism like UT.
>Thanks again for your help,