Login   /   Register

Forcibly close a specified window

Rate this article
     0 votes, average: 0 out of 50 votes, average: 0 out of 50 votes, average: 0 out of 50 votes, average: 0 out of 50 votes, average: 0 out of 5
Loading ... Loading ...
April 1st, 2008 by daniva

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

Posted in Windowing

Leave a Reply

You must be logged in to post a comment.

This article was viewed 401 times