Closing a window with the [x]

BlitzMax Forums/BlitzMax Beginners Area/Closing a window with the [x]

Is there a way to make the [x] at the top of the window work and close the window? (It worked in Blitz3D I think).

Graphics 640,480
While Not (KeyHit(KEY_ESCAPE) Or AppTerminate())
  DrawRect Rand(0,640),Rand(0,480),50,50
  Flip
Wend
PS: Loved Charlie the Duck :)

Thanks!!!