From d0fea7206345afbc5a3e8941395cdd88e7bbbe53 Mon Sep 17 00:00:00 2001 From: Xavi Date: Mon, 1 Mar 2010 03:06:26 +0000 Subject: [PATCH] 2010-03-01 04:05 UTC+0100 Xavi (jarabal/at/gmail.com) * harbour/src/rtl/gtwvt/gtwvt.c ! Fixing WM_CLOSE event (Clicked 'X' on system menu) to avoid irregular shutdown with SETCANCEL( .F. ) REQUEST HB_GT_WVT_DEFAULT ANNOUNCE HB_GTSYS PROCEDURE Main() SetCancel(.F.) ? "Click [X] Not close windows" while( LastKey() != 27 ) Inkey( 1 ) enddo RETURN --- harbour/ChangeLog | 15 +++++++++++++++ harbour/src/rtl/gtwvt/gtwvt.c | 6 +++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6df8d0cb0e..4d820b7af9 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,21 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-03-01 04:05 UTC+0100 Xavi (jarabal/at/gmail.com) + * harbour/src/rtl/gtwvt/gtwvt.c + ! Fixing WM_CLOSE event (Clicked 'X' on system menu) + to avoid irregular shutdown with SETCANCEL( .F. ) + + REQUEST HB_GT_WVT_DEFAULT + ANNOUNCE HB_GTSYS + PROCEDURE Main() + SetCancel(.F.) + ? "Click [X] Not close windows" + while( LastKey() != 27 ) + Inkey( 1 ) + enddo + RETURN + 2010-03-01 02:33 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/rddsql/sddsqlt3/sddsqlt3.c + Added support to retrieve buffers in UNICODE mode. diff --git a/harbour/src/rtl/gtwvt/gtwvt.c b/harbour/src/rtl/gtwvt/gtwvt.c index 2ecc4c52fa..40d7bef775 100644 --- a/harbour/src/rtl/gtwvt/gtwvt.c +++ b/harbour/src/rtl/gtwvt/gtwvt.c @@ -1691,11 +1691,15 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara case WM_CLOSE: /* Clicked 'X' on system menu */ if( hb_gt_wvt_FireEvent( pWVT, HB_GTE_CLOSE ) == 0 ) - { + { /* Avoid irregular shutdown if SetCancel( .F. ) [jarabal] */ + if( hb_setGetCancel() ) + hb_vmRequestCancel(); +# if 0 PHB_ITEM pItem = hb_itemPutL( NULL, HB_TRUE ); hb_setSetItem( HB_SET_CANCEL, pItem ); hb_itemRelease( pItem ); hb_vmRequestCancel(); +# endif } return 0;