Re: Help Closing Euphoria Windows
- Posted by Matthew Anderson <andy at anders98.freeserve.co.uk> Nov 18, 2002
- 387 views
This is a multi-part message in MIME format. ------=_NextPart_000_0004_01C28F1D.A1DAF4A0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0005_01C28F1D.A1DAF4A0" ------=_NextPart_001_0005_01C28F1D.A1DAF4A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The Euphoria Mailing List =3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=20 Hi Derek, Thanks for your help, but for some reason the returnValue(-1) thing didn't = work, so I have attached the routine I am trying. After selecting YES in th= e message box the program immediately closes. The program uses a number of = onEvent routines which all work fine. I hope you can spot my, no doubt, sil= ly mistake. I'm using an old version of Euphoria, prior to win32lib-055, be= cause I found that some of my existing programs didn't work with the new ve= rsion. I suppose you would recommend that ' I bite the bullet ' and ditch m= y old Euphoria library and get the current version ? What is the difference between the setHandler call (post 055) and the OnEve= nt call which I'm using? Please bear with me guys. Matthew=20 ----- Original Message -----=20 From: Derek Parnell=20 To: EUforum=20 Sent: 16 November 2002 18:24 Subject: Re: Help Closing Euphoria Windows =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The Euphoria Mailing List =3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=20 To prevent closing a window (using win32lib), do something like this... =20=20=20 procedure onClose_mywindow(integer self, integer event, sequence parms) if I_dont_want_to_close then returnValue(-1) end if end procedure setHandler(mywindow, w32HClose, routine_id("onClose_mywindow")) =20=20=20 ---------------- cheers, Derek Parnell ----- Original Message -----=20 From: Matthew Anderson=20 To: EUforum=20 Sent: Sunday, November 17, 2002 5:11 AM Subject: Help Closing Euphoria Windows =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The Euphoria Mailing List =3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=20 If I close a window by clicking top right, I want to be able to change = my mind if I then select YES in a message box. Program win32lib\ide.exw doe= s something similar with an onClose routine but there the window closing pr= ocess has already started and a new SAVEDATA window is opened. I want to ke= ep working in the old window. How can I do this? Also can someone please tell me how to access the version number of a W= indows DLL file using a Euphoria routine? Thanks Matthew =3D=3D^= ^=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D rds at RapidEuphoria.com b2kUNk.= cmRzQFJh =3D=3D^= ^=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ------=_NextPart_001_0005_01C28F1D.A1DAF4A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3D"text/html; charset=3Diso-8859-1" http-equiv=3DContent-Type= > <META content=3D"MSHTML 5.00.3314.2100" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <PRE>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The Euphoria Mailing List =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20 </PRE> <DIV><FONT size=3D2>Hi Derek,</FONT></DIV> <DIV><FONT size=3D2>Thanks for your help, but for some reason the returnVal= ue(-1)=20 thing didn't work, so I have attached the routine I am trying. After select= ing=20 YES in the message box the program immediately closes. The program uses a n= umber=20 of onEvent routines which all work fine. I hope you can spot my, no doubt, = silly=20 mistake. I'm using an old version of Euphoria, prior to win32lib-055, becau= se I=20 found that some of my existing programs didn't work with the new version. I= =20 suppose you would recommend that ' I bite the bullet ' and ditch my old Eup= horia=20 library and get the current version ?</FONT></DIV> <DIV><FONT size=3D2>What is the difference between the setHandler call (pos= t 055)=20 and the OnEvent call which I'm using?</FONT></DIV> <DIV><FONT size=3D2>Please bear with me guys.</FONT></DIV> <DIV><FONT size=3D2>Matthew</FONT> </DIV> <BLOCKQUOTE=20 style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0p= x; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"> <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV> <DIV=20 style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>Fro= m:</B>=20 <A href=3D"mailto:ddparnell at bigpond.com" title=3Dddparnell at bigpond.com>De= rek=20 Parnell</A> </DIV> <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A href=3D"mailto:EUforum@topi= ca.com"=20 <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> 16 November 2002 18:24</DIV>= <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Re: Help Closing Euphoria= =20 Windows</DIV> <DIV><BR></DIV><PRE>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The Euphoria Mai= ling List =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20 </PRE> <DIV><FONT face=3DArial size=3D2>To prevent closing a window (using win32= lib), do=20 something like this...</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>procedure onClose_mywindow(integer self, integer even= t,=20 sequence parms)</FONT></DIV> <DIV><FONT size=3D2> if I_dont_want_to_close then</FONT></DIV= > <DIV><FONT face=3DArial size=3D2> =20 returnValue(-1)</FONT></DIV> <DIV><FONT size=3D2> end if</FONT></DIV> <DIV><FONT size=3D2>end procedure</FONT></DIV> <DIV><FONT size=3D2>setHandler(mywindow, w32HClose,=20 routine_id("onClose_mywindow"))</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV>----------------<BR>cheers,<BR>Derek Parnell</DIV> <BLOCKQUOTE dir=3Dltr=20 style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: = 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"> <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV> <DIV=20 style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>F= rom:</B>=20 <A href=3D"mailto:andy at anders98.freeserve.co.uk"=20 title=3Dandy at anders98.freeserve.co.uk>Matthew Anderson</A> </DIV> <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A href=3D"mailto:EUforum@to= pica.com"=20 <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Sunday, November 17, 2002 = 5:11=20 AM</DIV> <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Help Closing Euphoria= =20 Windows</DIV> <DIV><BR></DIV><PRE>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The Euphoria M= ailing List =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20 </PRE> <DIV><FONT size=3D2>If I close a window by clicking top right, I want t= o be=20 able to change my mind if I then select YES in a message box. Program= =20 win32lib\ide.exw does something similar with an onClose routine but the= re=20 the window closing process has already started and a new SAVEDATA windo= w is=20 opened. I want to keep working in the old window. How can I do=20 this?</FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2>Also can someone please tell me how to access the v= ersion=20 number of a Windows DLL file using a Euphoria routine?</FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2>Thanks</FONT></DIV> <DIV><FONT size=3D2>Matthew</FONT></DIV></BLOCKQUOTE></BLOCKQUOTE> <PRE>=3D=3D^= =3D=3D^=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D rds at RapidEuphoria.com b2kUNk.= cmRzQFJh">http://topica.com/u/?b1dd66.= b2kUNk.= cmRzQFJh</A> com/partner/tag02/register</A> =3D=3D^= =3D=3D^=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</PRE> </BODY></HTML> ------=_NextPart_001_0005_01C28F1D.A1DAF4A0-- ------=_NextPart_000_0004_01C28F1D.A1DAF4A0 Content-Type: text/plain; name="onClose.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="onClose.txt" procedure Close_MainWindow() if changes = TRUE then -- give message and exit if IDYES = message_box("Database has not been updated\n" & "to reflect new data or changes\n" & "Update Database before Closing?", "Closing DLLFIND Program", MB_ICONQUESTION+MB_YESNO ) then returnValue(-1) end if end if end procedure -- setHandler(MainWindow,w32HClose,routine_id("Close_MainWindow")) onClose[MainWindow] = routine_id("Close_MainWindow") ------=_NextPart_000_0004_01C28F1D.A1DAF4A0--