FWPPC apps running in background

FWPPC apps running in background

Postby Antonio Linares » Mon Oct 26, 2009 8:48 am

By default, FWPPC does not allow that an application runs in background, as the user may close it and may not notice that the application is still running.

This example shows how to let a FWPPC run in background, if "x" is pressed:
Code: Select all  Expand view
#include "fwce.ch"
#include "winapi.ch"
 
#define SW_MINIMIZE  6
 
function Main()
 
   local oWnd := TMyWindow():New( "Click to exit",, nOr( WS_CAPTION, WS_SYSMENU ) )
 
   oWnd:Activate( { || oWnd:End() },,,, { || MsgYesNo( "Want to end ?", "Please select" ) } )
 
return nil
 
CLASS TMyWindow FROM TWindow
 
   METHOD HandleEvent( nMsg, nWParam, nLParam )
   
   METHOD End( nID )
 
ENDCLASS
 
METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TMyWindow
 
   do case
      case nMsg == WM_CLOSE
           ShowWindow( ::hWnd, SW_MINIMIZE )
           return 0
   
      case nMsg == WM_SIZE
           return nil          
   endcase
   
return Super:HandleEvent( nMsg, nWParam, nLParam )      
 
METHOD End( nID ) CLASS TMyWindow
 
   DEFAULT nID := 0
 
   if ::lValid()
      DestroyWindow( ::hWnd )
      ::nResult = nID
      return nil
   endif  
   
return 0      
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 15 guests