Trap closing .FMG

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
bzncrew

Trap closing .FMG

Post by bzncrew »

I need to trap the closing of a form and do some cleanup before releasing it.

I found ON KEY ESCAPE ACTION MIExit() works very well to trap the Esc key.
How do I call MIExit() if the user closes the form with the red X?
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Trap closing .FMG

Post by danielmaximiliano »

On Interactive Close

HMG Reference in file:///C:/hmg.3.2/doc/data/index.htm
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
mustafa
Posts: 1160
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Trap closing .FMG

Post by mustafa »

Hola bzncrew:
As said the friend Daniel ---> (Como ha dicho el amigo Daniel )
ON INTERACTIVECLOSE {||.F. }
Sample

DEFINE WINDOW Form_10 ;
AT 0,0 ;
WIDTH 1200 HEIGHT 700 ;
TITLE "Web Design Experts" ;
ICON 'Logo' ;
NOSIZE TOPMOST NOMINIMIZE NOMAXIMIZE ;
MAIN ;
FONT "Arial" SIZE 10 BACKCOLOR { 211,218,236 } ;
ON INIT password_control() ;
ON INTERACTIVECLOSE {||.F. } <----------- OK !

ON KEY ESCAPE ACTION FinalProgram()
ON KEY ALT+F4 ACTION ( MsgStop( 'Alt+F4 - Not Allowed', 'Attention !!!') , NIL )


Regars
Mustafa
Post Reply