1. Re: shellExecute()

Wolf,

I saw the "DaJaRo" jump to stuff in your tutorial's code, & didn't really
want to use it, but now that I have your useful example to refer to, I will
go ahead, thanks!  Maybe it would be potentially useful to have this
included in Win32Lib???

Dan


----- Original Message -----
From: "wolfgang fritz" <wolfritz at KING.IGS.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Saturday, September 02, 2000 7:10 AM
Subject: Re: shellExecute()


> > So now I have used it, & it works fine, but I have one last (ha!)
question:
> > how could I use it in a program to cause your tutorial to run?  I've
tried
> > every way to write the file name I could think of (except of course the
> > correct one), and couldn't get it to run.
>
> Dan B Moyer sent me the above question, and the short answer is:
> ...using the current version of shellExecute() in win32lib, you can't.
> It actually only uses three of the five parameters required for a 'full'
> shellExecute.
> Here's an example that 'wraps' all 5 parameters, that hopefully works.
> Note, I,m calling my tutorial 'beta' here, in the folder " I " have it in,
so
> you might have to change these. This ran from any folder/drive I tried it
> from.
> Hope this answers some shellExecute() questions... thanks to DaJaRo
> Wolf
>
> --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 Jump_to(integer id,sequence filename,
>   sequence defaultpath,sequence parameters, integer flag)
> sequence command, Filenam, DefaultPath, Parameters
> integer Nop
> atom command_ptr,Fnm_ptr,Prm_ptr,Dfp_ptr,hw
> 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
>
> constant
> Win=create(Window,"Test",0,0,0,200,100,0),
> FileMenu=create( Menu,"File",Win,0,0,0,0,0),
> RunMenu=create(MenuItem,"&Run Tutorial",FileMenu,0,0,0,0,0),
> ExitMenu=create(MenuItem,"E&xit",FileMenu,0,0,0,0,0)
> ----
> procedure onMenu_Exit()
> closeWindow(Win)
> end procedure
> onClick [ExitMenu] = routine_id("onMenu_Exit")
> ----
> procedure RunTut()
> Jump_to(
> -- passing your main window's id
> Win,
> -- with the program to call
> "exw.exe",
> -- this is my current 'tutorials' default path !!
> "c:\\EUwintutor\\EUwintutor\\",
> -- the parameter to pass to exw.exe
> "WinTutor.exw",
> -- and last, the 'show' parameter
> SW_SHOWDEFAULT )
> end procedure
> onClick [RunMenu] = routine_id("RunTut")
> ----
> WinMain(Win,Normal)
> --end example--

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu