How to close CRT APP by cliquing on the X

If you are converting a text-based Clipper application, a FoxPro application or just writing an application from scratch, use this forum for your eXpress++ questions.
Post Reply
Message
Author
User avatar
alepap
Posts: 94
Joined: Tue Jul 28, 2015 5:15 am

How to close CRT APP by cliquing on the X

#1 Post by alepap »

If you are looking on how to close you app in CRT mode, Hybride, you need to use event management and get xbeP_Close.
Clicking on the X will give you xbeP_Close


Code: Select all

      // Event loop = Program navigation
      nEvent := 0
      DO WHILE nEvent <> xbeP_Close
      
         nEvent := AppEvent( @mp1, @mp2, @oXbp )
         @ 05, 22 SAY PadR( Var2Char( nEvent ), 10 )
         
         // Catch the key after a GUI event
         IF VALTYPE(mp1) = "N" .AND. mp1 < 1000 .AND. mp1 <> 0
            k = mp1
            mp1 = 0
            @ 10, 22 SAY PadR( Var2Char( k ), 10 )
            k = 0
         ELSE
            oXbp:HandleEvent( nEvent, mp1, mp2 )
            k = LASTKEY() // TO GET THE FUNCTIONS
            @ 10, 22 SAY PadR( Var2Char( k ), 10 )
            k = 0
         ENDIF
         
      ENDDO
      
      ? "Quitting"
      inkey(1)

Post Reply