Guys:
How can I detect that the user closed a dialog via the Alt-F4 or pressing the ESC key ? Thank you.
Guys:
How can I detect that the user closed a dialog via the Alt-F4 or pressing the ESC key ? Thank you.
Hunter,
use VALID clause.
EMG
VALID(!GETKEYSTATE( 27 ))Local lOk1
ACTIVATE DIALOG oGrps NOWAIT ; // It has to be NonModal --> NOWAIT clause
ON INIT oGrps:Move(0,0);
ON PAINT (PalBmpDraw( hDC, 0, 0, oBmp:hBitmap ));
VALID (!GETKEYSTATE( 27 )) // do not allow esc key here
ACTIVATE WINDOW oWndChild ;
ON INIT ( ;
oWndChild:bResized := {|| oGrps:SetSize( oWndChild:nWidth, oWndChild:nHeight, .t. ) }, ;
oGrps:ReFresh());
VALID ( IIF( !lOk1, ExitPgm( .T.,@lOk1,oRsUtil,oBmp,oFontB ) , .F. )) // traps alt f4 and close with XEnrico, Rick:
Thank you very much ! Worked perfectly.