Este ejemplo muestra como permitir que una aplicación FWPPC se ejecute en segundo plano:
- Code: Select all Expand view RUN
- #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