Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ShellExecuteEX prototype

24 views
Skip to first unread message

Ashley Stahl

unread,
May 14, 2003, 10:54:49 AM5/14/03
to
Does anyone have ShellExecuteEX prototype and or example?

--
Regards,
Ashley Stahl


USCertifiedLetters, Inc.
ast...@uscertifiedletters.com


Jason S

unread,
May 14, 2003, 10:59:10 AM5/14/03
to
Look in libsrc\Windows.INC for the prototype.

taskOperation CSTRING(8)
taskFile CSTRING(2000)
taskParameters CSTRING(5)
taskDirectory CSTRING(5)
taskShowCmnd SIGNED

taskOperation = 'open'
!taskFile = 'http://www.SomeWhere.ca'
taskFile = 'mailto:Som...@SomeWhere.ca?subject=Tech
Support&body=Is that cool%0dOr what?'
taskParameters = ''
taskDirectory = ''
taskShowCmnd = 1

IF ShellExecute(Window{PROP:Handle}, taskOperation,
taskFile, taskParameters, taskDirectory, taskShowCmnd) < 33
MESSAGE('Error executing connection to :' &
taskFile,'Client: Shell Execute Error',ICON:Exclamation)
END


"Ashley Stahl" <ast...@uscertifiedletters.com> wrote in message
news:3ec25874$1...@news.softvelocity.com...

Ashley Stahl

unread,
May 14, 2003, 11:14:11 AM5/14/03
to
Thanks Jason, but I was looking for ShellExecuteEX. It is my understanding
that ShellExecuteEX will allow a WAIT that ShellExecute will not.

--
Regards,
Ashley Stahl


USCertifiedLetters, Inc.
ast...@uscertifiedletters.com
"Jason S" <--> wrote in message news:3ec259b0$1...@news.softvelocity.com...

Charles Edmonds

unread,
May 14, 2003, 1:39:30 PM5/14/03
to
"Ashley Stahl" <ast...@uscertifiedletters.com> wrote in message
news:3ec25cf6$1...@news.softvelocity.com...

> Thanks Jason, but I was looking for ShellExecuteEX. It is my understanding
> that ShellExecuteEX will allow a WAIT that ShellExecute will not.

Ashley,

If your looking to RUN with a WAIT(), you might want to get the FREE
PowerRun at www.berthume.com . It has always been a better solution IMHO.

Charles Edmonds
cje-ByteM...@lansrad.com

LANSRAD - "Intelligent Solutions for Universal Problems"
www.lansrad.com

John E. Christ III

unread,
May 14, 2003, 3:39:26 PM5/14/03
to
SHELLEXECUTEINFOgroup GROUP, TYPE
cbSize UNSIGNED
fMask UNSIGNED
hwnd UNSIGNED
lpVerb LONG
lpFile LONG
lpParameters LONG
lpDirectory LONG
nShow LONG
hInstApp UNSIGNED
! Optional members
lpIDList LONG
lpClass LONG
hkeyClass LONG
dwHotKey UNSIGNED
hIcon UNSIGNED
hProcess UNSIGNED
END

MODULE('win32.lib')
ShellExecuteEx(*SHELLEXECUTEINFOgroup), SIGNED, PASCAL, |
RAW, DLL, NAME('ShellExecuteExA')
WaitForSingleObject(UNSIGNED, LONG), UNSIGNED, PASCAL, |
NAME('WaitForSingleObject')
CloseHandle(UNSIGNED), SIGNED, PASCAL, NAME('CloseHandle')
END

sei LIKE(SHELLEXECUTEINFOgroup)
FileAction CSTRING(16)
FileName CSTRING(256)
Parameters CSTRING(256)
DefaultDirectory CSTRING(256)

FileAction = 'open'
FileName = 'myProgram.exe'
Parameters = ''
DefaultDirectory = ''

CLEAR(sei)
sei.cbSize = SIZE(sei)
sei.fMask = SEE_MASK_NOCLOSEPROCESS
sei.hwnd = Window{PROP:Handle}
sei.lpVerb = ADDRESS(FileAction)
sei.lpFile = ADDRESS(FileName)
sei.lpParameters = ADDRESS(Parameters)
sei.lpDirectory = ADDRESS(DefaultDirectory)
sei.nShow = SW_HIDE

IF ShellExecuteEx(sei)
I# = WaitForSingleObject(sei.hProcess, -1);
I# = CloseHandle(sei.hProcess);
END


Ashley Stahl

unread,
May 14, 2003, 4:42:33 PM5/14/03
to
Ahhh, just what the docter ordered. I will try it tomorrow!

Thanks, John

--
Regards,
Ashley Stahl


USCertifiedLetters, Inc.
ast...@uscertifiedletters.com
"John E. Christ III" <joh...@REMOVETHIStampabay.rr.com> wrote in message
news:3ec29b90$1...@news.softvelocity.com...

John E. Christ III

unread,
May 14, 2003, 6:10:02 PM5/14/03
to
Sorry, forgot these:

SW_HIDE EQUATE(0)
SEE_MASK_NOCLOSEPROCESS EQUATE(00000040h)


Ashley Stahl

unread,
May 15, 2003, 10:11:13 AM5/15/03
to
John, thanks for all the help! Question, calling the ShellExecuteEx(sei)
works fine but,
filename = 'www.uscertifiedletters.com'
sei.lpfile = address(filename)
Would you help me understand what the below actually does;
if ShellExecuteEX(sei) !this calls the web page just fine
I# = WaitForSingleObject(sei.hProcess, -1)
!this returns -1 everytime even when program was shut down
I# = CloseHandle(sei.hProcess)
!this always reurns zero
end

I thought I would put I# = WaitForSingleObject(sei.hProcess, -1) and I# =
CloseHandle(sei.hProcess) in a loop and wait for the return values like this

loop until I#
if WaitForSingleObject(sei.hProcess, -1) then ! closed
I# = CloseHandle(sei.hProcess)
else
I# = 0
end
end

I probably am mis-undertstanding the purpose.

--
Regards,
Ashley Stahl


USCertifiedLetters, Inc.
ast...@uscertifiedletters.com
"John E. Christ III" <joh...@REMOVETHIStampabay.rr.com> wrote in message

news:3ec2...@news.softvelocity.com...

John E. Christ III

unread,
May 15, 2003, 10:47:35 AM5/15/03
to
> Would you help me understand what the below actually does;
> if ShellExecuteEX(sei) !this calls the web page just fine
> I# = WaitForSingleObject(sei.hProcess, -1)

This waits for the process (whose handle is sei.hProcess) to terminate.

> !this returns -1 everytime even when program was shut down

That indicates the wait failed. Maybe IE won't allow a wait?

John


Ashley Stahl

unread,
May 15, 2003, 11:49:32 AM5/15/03
to
That is what is probably happening. I need to wait while they process a
credit card charge and then do an upload of data. I need to figure something
else out for this problem.

--
Regards,
Ashley Stahl


USCertifiedLetters, Inc.
ast...@uscertifiedletters.com
"John E. Christ III" <joh...@REMOVETHIStampabay.rr.com> wrote in message

news:3ec3...@news.softvelocity.com...

John E. Christ III

unread,
May 15, 2003, 1:58:14 PM5/15/03
to
Ashley,

Try this:

SW_SHOW EQUATE(5)

FileAction = 'open'
FileName = 'iexplore.exe'
Parameters = 'www.cnn.com'
DefaultDirectory = ''

CLEAR(sei)
sei.cbSize = SIZE(sei)
sei.fMask = SEE_MASK_NOCLOSEPROCESS
sei.hwnd = Window{PROP:Handle}
sei.lpVerb = ADDRESS(FileAction)
sei.lpFile = ADDRESS(FileName)
sei.lpParameters = ADDRESS(Parameters)
sei.lpDirectory = ADDRESS(DefaultDirectory)

sei.nShow = SW_SHOW

IF ShellExecuteEx(sei)
I# = WaitForSingleObject(sei.hProcess, -1);
I# = CloseHandle(sei.hProcess);
END

MESSAGE('IE Terminated.')

John


0 new messages