Exit button control with DLL ? (AppTitle)

Blitz3D Forums/Blitz3D Programming/Exit button control with DLL ? (AppTitle)

Raul(Posted 2012) [#1]
Hi,

Anyone can tell me if it is possible to improve the Blitz3D instruction "AppTitle" with .DLL, like "MessageBox()" in the user32 ?

The goal is to exit program but "save works" before (like Photoshop, when works has been modified).


Thanks !


Yasha(Posted 2012) [#2]
There's something called "BlitzClose.dll" that PaceMaker uses to achieve this, and a few other libs will as well (I expect it's a Kernel32 or User32 function actually, but haven't looked to see if it's there).


Rroff(Posted 2012) [#3]
I'd assume it uses some kinda callback mechanism in the API so supporting it natively in b3d could be tricky - tho not impossible but something of a hack.


Raul(Posted 2012) [#4]
Ok, thanks for quick answer because I did not find anything yet at msdn.windows.com


Yasha(Posted 2012) [#5]
...and to update my previous answer, you can get it here: http://www.melog.ch/dl/blitzclose.zip


Raul(Posted 2012) [#6]
Thank you.

Work fine !

... it's a bit strange that this method is not accessible by Windows standard DLL. But I notice some programs (like Photoshop) have their own DLL's too (perhaps for same reason).

Last edited 2012


Rroff(Posted 2012) [#7]
It is accessible with windows standard DLLs - problem is the b3d runtime doesn't hand win32 messages onwards to the b3d code so any API feature using callback type functionality doesn't work without some "hacking". In this case the dll tell the windows kernel to send the close event as a faked keystroke and within the code you watch for that keystroke to know when to react to the close event.

Last edited 2012


Raul(Posted 2012) [#8]
Yes, this is a clever process. I guess that Blitz3D is less oriented Windows API than BlitzPlus.

Last question: is 'www.melog.ch' author of this blitzclose.DLL ?

Thanks again to all informers !


Yasha(Posted 2012) [#9]
No, it comes from here: http://www.blitzbasic.com/codearcs/codearcs.php?code=832

The author is user Marcelo, who appears to have left these forums some seven years ago. "www.melog.ch" belongs to jfk EO-11110, a very helpful person who kindly continues to host a lot of these things when the originals disappear.


Raul(Posted 2012) [#10]
Thanks for this detailed informations !