Page 1 of 1

I am unable to get any information about a started program

Posted: Sun Nov 24, 2024 8:35 pm
by artnat
I found myself unable to get information about a program started with RunProgram.
Too make things simple I wrote the following code lines:

Code: Select all

p.l = RunProgram("C:\Users\hd\Desktop\DesktopOK_x64.exe", "", "", #PB_Program_Open)
Debug p
If IsProgram(p)
  Debug "ok"
Else 
  Debug "not valid"
EndIf
The program desktopOK is started.

The debug output is:
-1311699904
not valid

Whatever of the functions

IsProgram(); ProgramID(); ProgramRunning(); WaitProgram(); KillProgram(); ProgramExitCode(); CloseProgram()

I try, I always get the error line: Not a valid program.

What am I doing wrong?

Re: I am unable to get any information about a started program

Posted: Sun Nov 24, 2024 8:38 pm
by Bisonte
and if you are using : p.i and not p.l as Return Value ?

You get a handle... so if you are on a 64Bit use for handles always Integer.... not long !

Re: I am unable to get any information about a started program

Posted: Mon Nov 25, 2024 12:47 pm
by artnat
Many t hanks to Bisonte: I didn't think of a 64 bit handle. Now it works.