PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD19] How to find out running exe's
[WD19] How to find out running exe's
Iniciado por guest, 29,abr. 2015 11:40 - 4 respuestas
Publicado el 29,abril 2015 - 11:40
HI,

Need to know whether my exe is still running to avoid starting it a second time.

Selecting single instance in the Project description or using the function exerunning works only, if the exe is started by the same user.

I Need to know whether it is running by any user on the machine. In Windows Task Manager there is a button 'Show all processes' for that purpose.

Any idea how to achieve that with Windev?

Thanks

Erik
Publicado el 29,abril 2015 - 12:55
Hi Erik,

ExeRunning() ? (Not sure if it looks at the complete running list or only the current user)

Cheers,

Peter H.
Publicado el 29,abril 2015 - 14:11
Hi Erik,

ExeListProcess() will list all running processes. But I think that if you want all admin processes you will also need admin rights when your application is running. This must be tested if it's the case or not; I can't remember.

Best regards,
Alexandre Leclerc
Publicado el 30,abril 2015 - 08:56
Hi Peter and Alexandre,

you are on right lane.

ExeListProcess does not show all processes with Standard user.
If I start the app as Administrator, then all processes are shown.

Is there a way to tell my app, that it should run under admin rights, although a Standard user has started it?

Greetings

Erik
Publicado el 30,abril 2015 - 14:09
Hi Erik,

When you generate the EXE and you must select a manifest file, specify at that point that you need administrative rights. Then each time the application is started the user will be prompted to run as administrator, if required.

This is the simplest solution. (The more complicated solution is to do it by code, just check WDSETUP to see how PCSoft did it. We used the same code in other applications that can run for a while as standard admin but must restart with admin rights for some specific commands.)

Best regards,
Alexandre Leclerc