Re: Help needed to run programs from within EU program

new topic     » goto parent     » topic index » view thread      » older message » newer message

This is a multi-part message in MIME format.

------=_NextPart_000_0007_01C159B9.2333BE60
	charset="iso-8859-1"

in the attached file look near the bottom to setup the params
like this:

Exec_Prog(

-- passing your main window's id
1,

-- with the program to call e.g: "IE.exe"
"exw",

-- this is the default path !! e.g: "C:\\Window\\IE\\"
"C:\\euphoria\\bin\\",

-- the param to pass to exw.exe e.g "myhtm.html"
"ascii.ex",

-- and last, the 'show' parameter
SW_NORMAL )

You might want to rename some things for this to run with win32lib but,
it works as is now.

Euman
euman at bellsouth.net
> 

------=_NextPart_000_0007_01C159B9.2333BE60
Content-Type: application/octet-stream;
	name="shellexec3.exw"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="shellexec3.exw"

--start example--
include win32lib.ew
without warning

-- originally from DaJaRo jumpto.ew
atom lib
integer jJumpto    --id
if platform() = WIN32 then
lib = open_dll("shell32.dll")
jJumpto = define_c_func(lib,"ShellExecuteA",
  {C_INT,C_POINTER,C_POINTER,C_POINTER,C_POINTER,C_INT},C_INT)
if jJumpto = -1 then
puts(1,"couldn't find ShellExecuteA\n")
abort(1)
end if
end if

procedure Exec_Prog(integer id,sequence filename,sequence defaultpath,sequence
parameters, integer flag)
sequence command, Filenam, DefaultPath, Parameters
atom command_ptr,Fnm_ptr,Prm_ptr,Dfp_ptr,hw
integer Nop

   command = "Open"
   Filenam= filename
   Parameters=parameters
   DefaultPath=defaultpath
   
     command_ptr = allocate_string(command)
     Fnm_ptr = allocate_string(Filenam)
     Prm_ptr = allocate_string(Parameters)
     Dfp_ptr = allocate_string(DefaultPath)
     
   hw= getHandle(id )
   Nop=c_func(jJumpto,{hw,command_ptr,
   Fnm_ptr,Prm_ptr,Dfp_ptr,flag})
   
     free(command_ptr)
     free(Fnm_ptr)
     free(Prm_ptr)
     free(Dfp_ptr)
end procedure


Exec_Prog(

-- passing your main window's id
1,

-- with the program to call e.g: "IE.exe"
"exw",

-- this is the default path !! e.g: "C:\\Window\\IE\\"
"C:\\euphoria\\coolbmps\\",

-- the param to pass to exw.exe e.g "myhtm.html"
"coolwin2.exw",

-- and last, the 'show' parameter
SW_NORMAL )

------=_NextPart_000_0007_01C159B9.2333BE60--

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu