, , ,

Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

ShellExecute (OpenInsight 64-bit)

At 17 AUG 2023 08:51:57PM Gerry Van Niekerk wrote:

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


At 17 AUG 2023 08:54PM Gerry Van Niekerk wrote:

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


At 17 AUG 2023 09:39PM Andrew McAuley wrote:

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.

The Sprezzatura Group

The Sprezzatura Blog

World leaders in all things RevSoft


At 18 AUG 2023 04:13AM Carl Pates wrote:

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

Carl Pates


At 18 AUG 2023 04:15AM Carl Pates wrote:

And there is more background on ShellExecute here:

 https://revdevx.com/2021/07/14/the-saga-of-shellexecute/

Carl Pates


At 22 AUG 2023 09:43PM Gerry Van Niekerk wrote:

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 = 1
    filename1 = '@echo off':crlf:'start microsoft-edge:':filename
    dfile = 'startweb_':@username:'.bat'
    Oswrite filename1 On dfile
    Call Exec_Method( "SYSTEM", "RUNWIN", dfile, runparam )

* this works ok

  • Delay(3)
  • Osdelete dfile

this doesn't with or without adding 'microsoft-edge'

    filename ='microsoft-edge:':filename
    Call EXEC_METHOD('SYSTEM','RUNWIN',filename,runparam)
    or RTI_SHELLEXECUTEEX neither

so still confused.

Gerry


At 25 AUG 2023 12:57PM Carl Pates wrote:

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 Pates


At 29 AUG 2023 12:52AM Gerry Van Niekerk wrote:

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


At 29 AUG 2023 04:23AM Carl Pates wrote:

Hi Gerry,

In the System Monitor - what happens if you execute the following command?

   _em system shellexec "", open, http://www.csbmgmt.com.au/, "", "", 1

For 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,

Carl Pates

View this thread on the Works forum...