Contents page

Index

rtCloseWindowSafely


reqtools.library/rtCloseWindowSafely

  NAME  rtCloseWindowSafely() [V38]

rtCloseWindowSafely (window);

void rtCloseWindowSafely (struct Window *); A0

DESCRIPTION Closes a window which shares its IDCMP port with another window. All the pending messages (concerning this window) on the port will be removed and the window will be closed.

Do not use this function to close windows which have an IDCMP port set up by Intuition. If you do the port will be left in memory!

If you intend to open a lot of windows all sharing the same IDCMP port it is easiest if you create a port yourself and open all windows with newwin.IDCMPFlags set to 0 (this tells Intuition to NOT set up an IDCMP port). After opening the window set the win->UserPort to your message port and call ModifyIDCMP() to set your IDCMP flags.

When you then receive messages from intuition check the imsg->IDCMPWindow field to find out what window they came from and act upon them.

When closing your windows call rtCloseWindowSafely() for all of them and delete your message port. Easy peasy :-)

NOTE: Only call rtCloseWindowSafely() for windows with a shared IDCMP port. Do *NOT* call it for windows with an IDCMP port created by Intuition!

INPUTS window - pointer to the window to be closed.

RESULT none

NOTE This function is for the advanced ReqTools user.

BUGS none known

SEE ALSO intuition.library/CloseWindow()