Page 1 of 1

Cerrar shellexecute

PostPosted: Thu Feb 09, 2023 7:46 pm
by pedroluis
Hola gente !

Selecciono un archivo con shellexecute y pregunto si quiere o no abrirlo.

Como hago lyego para cerrarlo ?

Por Ejemplo

shellexecute(nil,"open",cfile,,,1)
if ! msgyesno("Planilla Correcta ?","???")
// ¿Como lo cierro si no es la planilla correcta ?........
clos data
return nil
endif

Re: Cerrar shellexecute

PostPosted: Thu Feb 09, 2023 9:09 pm
by Jimmy
hi,

you can "close" a Window when know it´s "Title"

Code: Select all  Expand view
PROCEDURE CloseWindow(cTitle)
LOCAL hWnd := FindWindowEx(,,, cTitle )

IF EMPTY(hWnd)
   MsgInfo("need Title of Windows to close")
ELSE
   IF !( hWnd == 0 )
      SetForegroundWindow( hWnd )
      BringWindowToTop( hWnd )
      ShowWindow( hWnd, 1 )
      UpdateWindow( hWnd )
      SendMessageA( hWnd, WM_CLOSE, 0, 0 )  
   ENDIF
ENDIF
RETURN