1. WIN32LIB - shellExecute

Hi all!
I've got a Win32Lib app that will be running on Win2000, and I want
to launch WordPad from my app. I'm trying shellExecute(), but it
doesn't seem to do anything. Here's the snippet of code:

   str = "C:\\program files\\windows NT\\accessories\\wordpad.exe "
   outfile = "C:\\rich.rtf"
   shellExecute(str,outfile, 0) 

The documentation says the 3 params are command,file,style. I'm sure 
I've got them wrong in my code, but there's no example. Can anyone help?

Thanks!

new topic     » topic index » view message » categorize

2. Re: WIN32LIB - shellExecute

This is a multi-part message in MIME format.

------=_NextPart_000_0011_01C0D333.D0951D40
	charset="iso-8859-1"

TRY the attached and tell me if it works..

Euman

----- Original Message ----- 
From: <michaelstee at yahoo.com>
To: "EUforum" <EUforum at topica.com>
Subject: WIN32LIB - shellExecute


> 
> 
> Hi all!
> I've got a Win32Lib app that will be running on Win2000, and I want
> to launch WordPad from my app. I'm trying shellExecute(), but it
> doesn't seem to do anything. Here's the snippet of code:
> 
>    str = "C:\\program files\\windows NT\\accessories\\wordpad.exe "
>    outfile = "C:\\rich.rtf"
>    shellExecute(str,outfile, 0) 
> 
> The documentation says the 3 params are command,file,style. I'm sure 
> I've got them wrong in my code, but there's no example. Can anyone help?
> 
> Thanks!
> 
> 
> 
> 
> 
> 

------=_NextPart_000_0011_01C0D333.D0951D40
Content-Type: application/octet-stream;
	name="shellexec2.exw"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="shellexec2.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 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),
OpenMenu=create(MenuItem,"&Open File",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 OpenFile()
Jump_to(
-- passing your main window's id
Win,
-- with the program to call
--"exw.exe",
"wordpad.exe",
-- this is my current 'tutorials' default path !!
"C:\\program files\\windows NT\\accessories\\",
-- the parameter to pass to exw.exe
"C:\\rich.rtf",

-- and last, the 'show' parameter
SW_HIDE )
end procedure
onClick [OpenMenu] = routine_id("OpenFile")
----
WinMain(Win,Normal)

------=_NextPart_000_0011_01C0D333.D0951D40--

new topic     » goto parent     » topic index » view message » categorize

3. Re: WIN32LIB - shellExecute

My fault, you'll need to change SW_HIDE to SW_NORMAL
near the bottom in OpenFile( )

Euman

----- Original Message ----- 
From: "Euman" <euman at bellsouth.net>
To: "EUforum" <EUforum at topica.com>
Subject: Re: WIN32LIB - shellExecute


> 
> 
> TRY the attached and tell me if it works..
> 
> Euman
> 
> ----- Original Message ----- 
> From: <michaelstee at yahoo.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Wednesday, May 02, 2001 14:46
> Subject: WIN32LIB - shellExecute
> 
> 
> > 
> > 
> > Hi all!
> > I've got a Win32Lib app that will be running on Win2000, and I want
> > to launch WordPad from my app. I'm trying shellExecute(), but it
> > doesn't seem to do anything. Here's the snippet of code:
> > 
> >    str = "C:\\program files\\windows NT\\accessories\\wordpad.exe "
> >    outfile = "C:\\rich.rtf"
> >    shellExecute(str,outfile, 0) 
> > 
> > The documentation says the 3 params are command,file,style. I'm sure 
> > I've got them wrong in my code, but there's no example. Can anyone help?
> > 
> > Thanks!
> > 
> > 
> > 
> > 
> > 
> > 
> 
> 
>

new topic     » goto parent     » topic index » view message » categorize

4. Re: WIN32LIB - shellExecute

Howdy!

Works on WinME!

-- Travis --



5/2/2001 6:42:05 PM, Euman <euman at bellsouth.net> wrote:

>> 
>> 
>> TRY the attached and tell me if it works..
>> 
>> Euman

new topic     » goto parent     » topic index » view message » categorize

5. Re: WIN32LIB - shellExecute

The ShellExec( ) in Win32lib varies only slightly
but with the demo i gave you, the key to makeing win32libs
work is contained there. Look at OpenFile( ) and try to feed
win32libs function the same info. if it works great if it doesnt,
e-mail me and I'll help you get it going.

Euman

----- Original Message ----- 
From: <michaelstee at yahoo.com>
To: "EUforum" <EUforum at topica.com>
Subject: RE: WIN32LIB - shellExecute


> 
> 
> 
> Euman wrote:
> > TRY the attached and tell me if it works..
> > 
> 
> Works wonderful (in both WinMe and Win98) !!
> Thanks a lot! But out of curiousity, why doesn't the shellExecute()
> work?
> 
> Michael.
> 
> 
> 
> 
> 
>

new topic     » goto parent     » topic index » view message » categorize

6. Re: WIN32LIB - shellExecute

--part1_84.15abb7ff.282afee4_boundary

Please unsubscribe me?  I'm learning lots from you folks, but am short on 
time the next two months.

thanks for all you didn't realize you've taught me -

Mary (who lurks)


--part1_84.15abb7ff.282afee4_boundary

<HTML><FONT FACE=arial,helvetica><FONT  SIZE=2>Please unsubscribe me? &nbsp;I'm
learning lots from you folks, but am short on
<BR>time the next two months.
<BR>
<BR>thanks for all you didn't realize you've taught me -
<BR>
<BR>Mary (who lurks)

--part1_84.15abb7ff.282afee4_boundary--

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu