Hi,
is it possible to launch shellexecute that opens a folder and to perform immediately a search for a file mask passed as parameters?
For Instance Open f:\myapp\report\ folder and search all files 202405*.pdf
Bye
// C:\FWH\SAMPLES\MARCOBOS.PRG
#include "FiveWin.Ch"
#include "Directry.ch"
#define CLR_LGREEN nRGB( 190, 215, 190 )
#define CLR_LGRAY nRGB( 230, 230, 230 )
#define CLR_VERMELHO nRGB( 255, 000, 000 )
#define CLR_AMARELO nRGB( 255, 255, 000 )
REQUEST OrdKeyNo, OrdKeyCount, OrdCreate, OrdKeyGoto
STATIC nBytes, nDisks
STATIC lnKeyEscape := .F.
FUNCTION Main()
LOCAL oSetupDlg, nDriveTo := 1, cDriveTo, nDriveCap := 4
LOCAL lGoOn, aFiles[ 1 ], aFileList, x, iDcor, oFont, oBackup
LOCAL oDlg, oBrw, n := 1
LOCAL oAceitar, oCancelar, nKey := VK_RETURN
LOCAL aPdfs := Directory( "C:\TEMP\*.PDF" )
// LOCAL aPdfs := DirectoryRecurse( "C:\FWH1701\*.*" )
// LOCAL aPdfs := DirectoryRecurse( "*.PDF" )
SET CENTURY ON
// SET DATE BRITISH
SET DATE AMERICAN
SET TIME FORMAT TO "HH:MM:SS"
SET EPOCH TO Year( Date() ) - 30
SET SOFTSEEK OFF
SET WRAP ON
SetCancel( .F. )
SET CONFIRM OFF
SET DELETED ON
SET _3DLOOK ON
SET UNIQUE OFF
SET ESCAPE OFF
SET EXACT ON
SET EXCLUSIVE OFF
SET MULTIPLE OFF
SkinButtons()
IF Len( aPdfs ) < 1
RETURN NIL
ENDIF
// aSort( aPdfs, , , { |x, y | x[1] < y[1] } )
ASort( aPdfs )
DEFINE FONT oFont NAME "Arial" SIZE 0, 16 BOLD
DEFINE DIALOG oDlg FROM 6, 20 TO 25, 90 ;
TITLE "PDFs File Browser at: " + ;
CurDir() + " To View" ;
STYLE nOR( WS_BORDER, WS_THICKFRAME ) ;
COLORS CLR_BLACK, nRGB( 193, 205, 205 )
@ 1, 2 LISTBOX oBrw FIELDS aPdfs[ n ][ 1 ], ;
Str( aPdfs[ n ][ 2 ], 10, 0 ), ;
DToC( aPdfs[ n ][ 3 ] ), ;
aPdfs[ n ][ 4 ] ;
Headers "File Name", ;
"Size", "Date", "Hour" ;
FIELDSIZES 270, 80, 80, 60 ;
COLOR CLR_HBLUE, CLR_AMARELO ;
FONT oFont ;
Of oDlg Size 260, 100
oBrw:bGotop := {|| N := 1 }
oBrw:bGoBottom := {|| N := Eval( oBrw:bLogicLen ) }
oBrw:bSkip := {| nWant, nOld | nOld := N, N += nWant, ;
N := Max( 1, Min( N, Eval( oBrw:bLogicLen ) ) ), ;
N - nOld }
oBrw:bLogicLen := {|| Len( aPdfs ) }
oBrw:cAlias := "Array"
oBrw:nClrBackHead := CLR_LGREEN
oBrw:nClrBackFocus := CLR_HRED
oBrw:nClrForeFocus := CLR_AMARELO
oBrw:nClrForeHead := CLR_HRED
oBrw:nColAct := 1
oBrw:nLineStyle := 3
oBrw:lCellStyle := .T.
oBrw:aJustify := { .F., .F., .F., .F. }
oBrw:lMChange := .F.
oBrw:SetFocus()
oBrw:Refresh()
@ 6.6, 20 Button oBackup PROMPT "&Exit" Of oDlg ;
ACTION( oDlg:End() ) SIZE 40, 12 CANCEL
ACTIVATE DIALOG oDlg CENTERED
oFont:End()
RETURN NIL
// FIN / END - kapiabafwh@gmail.com
#include "FiveWin.ch"
#define OFN_ENABLESIZING 0x00800000
FUNCTION Main()
LOCAL cNomFich := "*.PDF"
LOCAL cDir // := "..\samples\"
LOCAL cFiles
// cDir := GetWinDir()
// cDir := cFilePath( GetModuleFileName( GetInstance() ) )
// cDir := hb_CurDrive() + ":\" + CurDir()
cDir := "C:\TEMP\"
cFiles := cNomFich
// cGetFile("ficheros include(*.ch)|*.ch|","Elija el fichero include.", ,"c:\fwh\include",.F., , ,"fivewin.ch")
// cGetFile( "Todos los archivos (*.*)|*.*", "Contenido de la carpeta",, cFiles,,,OFN_ENABLESIZING,,)
cGetFile( cNomFich + "|" + cNomFich, "Elija el fichero.", 1, cDir, .F., .T. )
RETURN NIL
// C:\FWH\SAMPLES\VISUALPDF.PRG
#Include "FiveWin.ch"
FUNCTION Main()
LOCAL cPathImg, cDirPDfs
cDirPDfs := "C:\TEMP" // GETCURDIR()
IF SUBS( cDirPDfs, LEN( ALLTRIM(cDirPDfs ) ) , 1 ) = "\"
cDirPDfs := SUBS( cDirPDfs, 1 , LEN( ALLTRIM(cDirPDfs ) ) - 1 )
ENDIF
LCHDIR( cDirPDfs )
cPathImg := cDirPDfs + "\"+ "*.PDF"
cFile := cGetFile( "PdfFile(*.Pdf)|*.Pdf|", ;
"Select a File", CurDir(), .T. )
RETURN NIL
// FIN / END
karinha wrote:+1
- Code: Select all Expand view
// C:\FWH\SAMPLES\VISUALPDF.PRG
#Include "FiveWin.ch"
FUNCTION Main()
LOCAL cPathImg, cDirPDfs
cDirPDfs := "C:\TEMP" // GETCURDIR()
IF SUBS( cDirPDfs, LEN( ALLTRIM(cDirPDfs ) ) , 1 ) = "\"
cDirPDfs := SUBS( cDirPDfs, 1 , LEN( ALLTRIM(cDirPDfs ) ) - 1 )
ENDIF
LCHDIR( cDirPDfs )
cPathImg := cDirPDfs + "\"+ "*.PDF"
cFile := cGetFile( "PdfFile(*.Pdf)|*.Pdf|", ;
"Select a File", CurDir(), .T. )
RETURN NIL
// FIN / END
Regards, saludos.
#include "FiveWin.ch"
FUNCTION CDIR_SILVIO()
LOCAL cDir
LOCAL cDirName := GetCurDir()
cDir := cGetDir32( cDirName )
SetCurDir( cDir )
? cDir
RETURN NIL
// FIN / END
karinha wrote:Silvio, esto?
https://forums.fivetechsupport.com/viewtopic.php?f=6&t=35188&p=209498&hilit=cgetdir&sid=d31672f202782c50247b18cb082f2f0e&sid=d31672f202782c50247b18cb082f2f0e#p209415
- Code: Select all Expand view
#include "FiveWin.ch"
FUNCTION CDIR_SILVIO()
LOCAL cDir
LOCAL cDirName := GetCurDir()
cDir := cGetDir32( cDirName )
SetCurDir( cDir )
? cDir
RETURN NIL
// FIN / END
Regards, saludos.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 65 guests