#include once "window9.bi"

Function RunProgram(ByRef Filename As USTRING, ByRef Parameter As USTRING,_
					ByRef WorkingDirectory As USTRING, ByRef Flags As USTRING,_
					ByVal ShowCmd As integer) As integer  Export
	#ifdef UNICODE
		Return cast(integer,ShellExecute(0,Cast(LPCTSTR,*Flags) , Cast(LPCTSTR,*Filename),_
		cast(LPCTSTR,*Parameter),Cast(LPCTSTR,*WorkingDirectory) , ShowCmd))
	#else
		Return cast(integer,ShellExecute(0,Cast(LPCTSTR,StrPtr(flags)) , Cast(LPCTSTR,StrPtr(Filename)),_
		cast(LPCTSTR,StrPtr(Parameter)),Cast(LPCTSTR,StrPtr(WorkingDirectory)) , ShowCmd)) 	
	#EndIf
End Function
