Hello everyone
there is a procedure whenexit() ,which for on release event.
I hope I can run exe file individual by parameter.
For example,missopd.exe ->normal running,missopd.exe 0 ->do onrelease and close missopd.exe
I had tried setproperty(),do events and fail.
PLS HELP!
Best Regards
How to force on release event executed?
Moderator: Rathinagiri
-
huangchenmin
- Posts: 157
- Joined: Mon Jun 07, 2010 2:24 am
How to force on release event executed?
- Attachments
-
- MissOPD.rar
- (3.97 KiB) Downloaded 212 times
- dhaine_adp
- Posts: 457
- Joined: Wed Aug 06, 2008 12:22 pm
- Location: Manila, Philippines
Re: How to force on release event executed?
Hi,
Please try including ON INTERACTIVECLOSE on your windows definition:
WhenExit() is triggered on two places:
(1) ON RELEASE, when you do a domethod("Form_MOPD","Release") or Form_MOPD.Release
(2) ON INTERACTIVECLOSE also fires up WhenExit() when you click the Window Close box [x].
IMHO, you can code the exit procedure or application termination as follows
*******************************
function DestroyWindow() // because you declared this window as main, right?
DBCLOSEALL()
DeleteAllYourTempFile() // Your UDF to removed the temporary files used by the apps.
RELEASE ALL
RELEASE WINDOW ALL // this effectively terminates all window. anywhere in your code
// other than here, your application terminates if you issue this command so
// use it with caution
RETURN NIL
Please try including ON INTERACTIVECLOSE on your windows definition:
Code: Select all
DEFINE WINDOW Form_MOPD;
AT 08,176;
WIDTH 885;
HEIGHT 680;
TITLE "¹w¬ù¥¼¦^ÃöÃh";
ICON "Default";
ON Init if(marg==NIL,LoadMIL(),just4Impt());
ON release WhenExit();
ON INTERACTIVECLOSE WhenExit(); <<--- Add this line
MAIN
(1) ON RELEASE, when you do a domethod("Form_MOPD","Release") or Form_MOPD.Release
(2) ON INTERACTIVECLOSE also fires up WhenExit() when you click the Window Close box [x].
IMHO, you can code the exit procedure or application termination as follows
*******************************
function DestroyWindow() // because you declared this window as main, right?
DBCLOSEALL()
DeleteAllYourTempFile() // Your UDF to removed the temporary files used by the apps.
RELEASE ALL
RELEASE WINDOW ALL // this effectively terminates all window. anywhere in your code
// other than here, your application terminates if you issue this command so
// use it with caution
RETURN NIL
Regards,
Danny
Manila, Philippines
Danny
Manila, Philippines
- srvet_claudio
- Posts: 2224
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: How to force on release event executed?
Hi Huangchenmin
Change in your code:
I hope have been useful.
Best regards,
Claudio Soto.
Change in your code:
Code: Select all
function just4Impt()
MsgInfo("here in just4Impt()")
Form_MOPD.Release
return
Best regards,
Claudio Soto.
- srvet_claudio
- Posts: 2224
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: How to force on release event executed?
Great Dhaine, very good explanation.
Thanks.
Best regards,
Claudio.
Thanks.
Best regards,
Claudio.
-
huangchenmin
- Posts: 157
- Joined: Mon Jun 07, 2010 2:24 am
Re: How to force on release event executed?
dhaine_adp wrote:Hi,
Please try including ON INTERACTIVECLOSE on your windows definition:
Code: Select all
.................. RETURN NIL[/quote] Thanks for your supports! Great help to me. Best Regards chen min
-
huangchenmin
- Posts: 157
- Joined: Mon Jun 07, 2010 2:24 am
Re: How to force on release event executed?
Thanks for your supportssrvet_claudio wrote:Hi Huangchenmin
Change in your code:I hope have been useful.Code: Select all
............ return
Best regards,
Claudio Soto.
Simple and useful.
Best Regards
chen min