win_activate(sWindow) : Suppose there are several windows (sWindow one of them)opened on your desktop,and you want to run your code on 'sWindow',
win_activate () function will bring this window into focus and raise it to the top of the display. Next function after win_activate() should always be set_window().
set_window(sWindow,time) : function specifies the window to recieve subsequent input. "time" specifies the amount of time to wait for the specified window(sWindow).
This function also set the scope for object identification in the GUI map.
If there are several windows opened on screen then its always better to use win_activate () followed by set_window(), but if there's only single window opened then set_window() is enough.
Note: In multiple window case, set_window() alone can work fine but using win_activate() will minimize the chances of errors if any.
If window is minimized,don't rely on set_window() as it will always return E_OK where as win_activate() will return error code.
Hope above explanation answers your query.
Regards,
-AK

1 User has rated as useful.
Login to rate this answer.
Set_window (This is the fuction to focus that particular window, Examble Set_window("Login",5); Now the winrunner focus the Login window if it is opened the window will focus else you will get a error message Winrunner cant identfy),
Win_activate (This is the function to check that particular window opened or not, If it is opened no problam winrunner go to next step of the TSL Script, And If it is not opened It will show the error like Winrunner cant identfy)
If any thing is wrong plz inform me...
Login to rate this answer.