Hi All,
Can someone please explain to me what I am doing wrong.
Do I need to do any setups..
This command DOESN'T work.
action = 'Open'
file = 'C:\WINDOWS\SYSTEM32\NOTEPAD.EXE'
hwnd =
path =
hprocess=
RetVal = RTI_SHELLEXECUTEEX(hWnd, action, file,
, Path, 0,hprocess)However this works
path = 'C:\WINDOWS\SYSTEM32\NOTEPAD.EXE'
cmd = path
STAT = UTILITY("RUNWIN", CMD)
Gerry
PS
I am trying to get the handle of this process so I can wait for the form to be closed to return to processing further in my procedure.
Any other way I can do this?
Gerry
PS
I am trying to get the handle of this process so I can wait for the form to be closed to return to processing further in my procedure.
Any other way I can do this?
Gerry
https://revdevx.files.wordpress.com/2022/01/065-system-object.pdf
Check the docs on the SYSTEM methods RUNWIN and SHELLEXEC. These are the OI 10 ways of doing it.
World leaders in all things RevSoft
Hi Gerry,
Did you want the program to be launched hidden? If I pass a show command of "1" (SW_NORMAL$) then it works fine?
Regards
And there is more background on ShellExecute here:
https://revdevx.com/2021/07/14/the-saga-of-shellexecute/
Ok
Didn't have process set to 1
most programs now run ok
However, when trying to open a website in Edge it works when you run from 'run' command but not as follows:
filename = 'http://www.csbmgmt.com.au/'runparam = 1filename1 = '@echo off':crlf:'start microsoft-edge:':filenamedfile = 'startweb_':@username:'.bat'Oswrite filename1 On dfileCall Exec_Method( "SYSTEM", "RUNWIN", dfile, runparam )* this works ok
Delay(3)
Osdelete dfilethis doesn't with or without adding 'microsoft-edge'
filename ='microsoft-edge:':filenameCall EXEC_METHOD('SYSTEM','RUNWIN',filename,runparam)or RTI_SHELLEXECUTEEX neitherso still confused.
Gerry
Hi Gerry,
Looks like you're trying to execute a batch file rather than an actual program - shellExcute is not really designed to do that - it's designed to execute the program from a document or URL.
If all you want to do is navigate to a website then you just pass the URL to shellExecute - it will take care of finding the browser program and loading it.
Carl,
Thats the issue
Shellexecute Doesn't open the url, hence having to do it a different way, ie by using a batch file.
it opens Edge (default) but not the url.
Gerry
Hi Gerry,
In the System Monitor - what happens if you execute the following command?
_em system shellexec "", open, http://www.csbmgmt.com.au/, "", "", 1For me it loads your website in my default browser (which happens to be FireFox at the moment). Does this work for you? If not then the issue is something specific to your workstation as all of the ShellExecute methods in the system are just very thin wrappers around the OS-supplied functionality.
Regards,