Window closed message?

Blitz3D Forums/Blitz3D Programming/Window closed message?

Pudding(Posted 2004) [#1]
Is there any way to intercept the windows closed message in Blitz3d?

I'm writing an app that remembers its position and size (stored in an ini file). It works as long as the user exits using Escape, or Alt F4, but if the user clicks on the windows close button I can't save the ini file...

Is there a way to do this?

-Pudding


Rob(Posted 2004) [#2]
Maybe code archives. I need this ability too, coincidentially. I think Fredborg does it in Gile[s]


Rob(Posted 2004) [#3]
http://www.blitzbasic.com/codearcs/codearcs.php?code=831

Here we are. It disables the x. I want to be able to intercept it though. Not sure how to make the decls either.


fredborg(Posted 2004) [#4]
Hi,

Marcelo did a dll which can be used to grab the close event to a keyboard hit. So you can use KeyHit() to find out if the user clicked the close icon.

It's toward the bottom of this thread: http://www.blitzbasic.com/Community/posts.php?topic=27586


Rob(Posted 2004) [#5]
Thanks Fredborg. Have you any idea why it insists on crashing when it exits?


fredborg(Posted 2004) [#6]
InstallCloseHandler(bla,bla)
Repeat
Until KeyHit(myexitkey)
UninstallCloseHandler() ;<-- The cunning bit :)
End



Rob(Posted 2004) [#7]
How dastardly :)


Pudding(Posted 2004) [#8]
Awesome! Thanks!

-Pudding