BBC BASIC for Windows
« ON CLOSE sometimes does not work »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 9:55pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: ON CLOSE sometimes does not work  (Read 651 times)
g3nrw
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 74
xx ON CLOSE sometimes does not work
« Thread started on: Feb 11th, 2015, 7:55pm »

I have incorporated an ON CLOSE statement in a program, giving the user the opportunity save settings when clicking on Windows Close (the "x" in the Title Bar). I followed the model in BB4W Help:
Code:
ON CLOSE PROCclose : RETURN
REPEAT
  REM Do something useful here!
UNTIL FALSE
;
DEF PROCclose : LOCAL ans$
REPEAT UNTIL INKEY(0) = -1
INPUT '"Do you really want to exit",ans$
IF LEFT$(ans$,1) = "y" OR LEFT$(ans$,1) = "Y" THEN QUIT
ENDPROC
 

This works as expected on 3 different Windows systems here (Win XP, Win 7/32, Win 8.1/64). When you click on "x", a message box pops up, giving you the option to click on "Yes/No/Cancel". No problem.

However, I have now had feedback from a Win 8.1/64 user, saying that when he clicks on the "x" to close the window, nothing at all happens. No "Yes/No/Cancel" message appears. Otherwise the program continues running normally, and the only way to stop it is to kill it with Windows Task Manager.

Has anyone here seen anything like this?

--
Ian
User IP Logged

rtr2
Guest
xx Re: ON CLOSE sometimes does not work
« Reply #1 on: Feb 11th, 2015, 8:18pm »

on Feb 11th, 2015, 7:55pm, g3nrw wrote:
when he clicks on the "x" to close the window, nothing at all happens. No "Yes/No/Cancel" message appears. Otherwise the program continues running normally

What happens if you remove or disable the ON CLOSE? Does the window then close normally?

If you haven't already done so, it would be sensible to check whether the other methods of closing a window work:
  • Press Alt+F4.

  • Right-click in the title bar and select Close from the context menu.

  • Send a WM_CLOSE message from another application.
According to which of these work and which don't work you might be able to rule out possible causes.

Richard.
« Last Edit: Feb 11th, 2015, 8:21pm by rtr2 » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls