Forcibly Close a Specified Window

Article Tools

The EndTask function is called to forcibly close a specified window.

API syntax : BOOL EndTask( HWND hWnd, BOOL fShutDown, BOOL fForce );

Parameters :

clip_image001 hWnd – [in] Handle to the window to be closed.

clip_image001[1] fShutDown – [in] Ignored. Must be FALSE.

clip_image001[2] fForce – [in] A TRUE for this parameter will force the destruction of the window if an initial attempt fails to gently close the window using WM_CLOSE. With a FALSE for this parameter, only the close with WM_CLOSE is attempted.

Return Value :

clip_image001[3] If the function succeeds, the return value is nonzero.

If the function fails, the return value is FALSE.

Extern.Declare micInteger, "EndTask", "user32.dll", "EndTask", micHWnd, micInteger, micInteger
Browser("B").Close
Wait 5
If Browser("B").Exist( 0 ) Then
   hwnd = Browser("B").GetROProperty( "hwnd" )
   bRetval = Extern.EndTask( hWnd, False, True )
End If
Previous postMinimizing a Window Next postFind a Window

Related Posts

Post Your Comment

You must be logged in to post a comment.