Hi,
ich nutze es so:
Code: Alles auswählen
lSuccess := DllCall( "SHELL32.DLL" , DLL_STDCALL, ;
"ShellExecuteA", AppDesktop():GetHWND(), "open", cPath+cFile,;
NIL, CurDir(), SW_NORMAL )
oder auch so:
Code: Alles auswählen
RunDefaultShellProg( cFile, SHELL_PRINT, SW_MINIMIZE )
bzw.
RunDefaultShellProg( cFile, SHELL_OPEN, SW_MAXIMIZE )
******************************************************************************
FUNCTION RunDefaultShellProg( cFile, cMode, nShow )
* Ein Standardprogramm öffnen oder über ein Standardprogramm drücken
* Parameter: cFile -> Datei welche geöffnet oder gedruckt werden soll
* cMode -> SHELL_OPEN für Datei öffnen
* -> SHELL_PRINT für Datei drucken
* nShow -> SW_MAXIMIZE
* -> SW_MINIMIZE
* Return : NIL
******************************************************************************
LOCAL nRet := 0
DO CASE
CASE cMode == SHELL_PRINT
// Druck im Hintergrund starten
nRet := WinAPIPrint( cFile, , , nShow )
IF ! (nRet > 32)
MsgBox( ... )
nRet := -1
ENDIF
CASE cMode == SHELL_OPEN
nRet := WinAPIOpen( cFile, , , nShow )
IF ! nRet
MsgBox( ... )
nRet := -1
ENDIF
ENDCASE
RETURN nRet
FUNCTION WinAPIPrint( cFile, cParms, cDirectory, nOpenMode )
DEFAULT nOpenMode TO SW_HIDE, ;
cDirectory TO CurDir()
RETURN wapiShellExecute( AppDesktop():GetHWND(), "print", cFile, cParms, CurDir(), nOpenMode )
FUNCTION WinAPIOpen( cFile, cParms, cDirectory, nOpenMode )
DEFAULT nOpenMode TO SW_HIDE, ;
cDirectory TO CurDir()
RETURN wapiShellExecute( AppDesktop():GetHWND(), "open", cFile, cParms, CurDir(), nOpenMode ) > 32
FUNCTION wapiShellExecute( nHWND,cOperation,cFile,cParms,cDirectory,nOpenMode)
STATIC cTpl := NIL
LOCAL nDll :=DllLoad("SHELL32.DLL")
LOCAL xRet := NIL
if cTpl == NIL
cTpl := DllprepareCall(nDll,32 ,"ShellExecuteA")
endif
xRet := DLLExecuteCall( cTpl , nHWND,cOperation,cFile,cParms,cDirectory,nOpenMode )
RETURN xRet
Vielleicht hilft es Dir ein wenig weiter?