ShellExecuteA()

forum.sourcecode (2000-2005) & forum.td.sourcecode (2005-2010)
LEd

ShellExecuteA()

Post by LEd » 24 Oct 2006, 00:48

 Posted by:  LEd 

I think I need to use ShellExecuteA() intead of SalLoadApp and
SalLoadAppAndWait. These two functions won't let me open an exe in a remote
server. I mean the exes are in a server and can not be launched by these
functions but when I run in the command line \\server1\myapp\\app.exe -par1,
par2,par3 work well.

My question is how can I use ShellExecuteA() considering that I never use
CDK functions. Thanks guys for your help.

Ed

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2385
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: ShellExecuteA()

Post by Jeff Luther » 24 Oct 2006, 05:25

 Posted by:  Jeff Luther 

The function you want is actually part of the Windows API, not TD's CDK. In any
event, declare the function in the ext. functs. area like this:

Code: Select all

Library name: SHELL32.DLL
	ThreadSafe: No
	Function: ShellExecuteA
		Description:
		Export Ordinal: 0
		Returns
			Number: INT
		Parameters
			Window Handle: HWND
			String: LPSTR
			String: LPSTR
			String: LPSTR
			String: LPSTR
			Number: INT

Constants
     System
	Number: SW_SHOWNORMAL	    =1
Then you can call it something like:

Code: Select all

! p_sFilename = some file you want to open...
Set l_nReturn = ShellExecuteA( hWndNULL, "open", p_sFilename, "", "", SW_SHOWNORMAL )
If l_nReturn <= 32
	! error
Else
	! -- evergthing fine
	Return TRUE
And for some info. straight from MS, here's a link to the function from a VB perspective:
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarvb4/html/msdn_shelexec.asp

Best Regards,
Jeff Luther/PC Design
info: www.pulpcards.com/gupta/

Markus Weiland

Re: ShellExecuteA()

Post by Markus Weiland » 27 Oct 2006, 05:59

 Posted by:  WEILAND Markus 

definition from CTD1.5.1

Code: Select all

!!CB!! 145
Function: ShellExecuteA
 Description:
 Export Ordinal: 0
 Returns
  Number: LONG
 Parameters
  Window Handle: HWND
  String: LPSTR
  String: LPSTR
  String: LPSTR
  String: LPSTR
  Number: INT
i hope it helps you.

Markus.

Return to “td.sourcecode”

Who is online

Users browsing this forum: No registered users and 0 guests