- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a function to tell if a specific application is running?
I would like to pass the application executable name and get back true or false to say if it is running.
Or maybe something like the Windows task manager that gives a list of processes running.
Is there anything like that in CVF?
Thanks,
David
I would like to pass the application executable name and get back true or false to say if it is running.
Or maybe something like the Windows task manager that gives a list of processes running.
Is there anything like that in CVF?
Thanks,
David
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In CVF? I doubt it, but what you want is available from the Win32 API. Life is easier if the application you're looking for has a top level window; use FindWindow or EnumWindows api functions. If not, then EnumProcesses may be the ticket, but the path will be harder. See MSDN docs (either installed with CVF or on the web) for more on these functions. You may also want to to see MS KB article Q175030 - HOWTO: Enumerate Applications in Win32
hth,
John
hth,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
David
If you don't want to mess with Windows APIs, I've had pretty good success by using the Fortran file system to signal between applications. When the application you want to check for starts, just have it open a file, write a single character to it, and then close it (STATUS='KEEP'). Other processes can check for the file's existence with an INQUIRE (FILE=...) and determine if the first application is operating. Of course, the monitored application needs to close and delete the file before it STOPs.
This method has the advantage of being portable and does not depend on the operating system, computer hardware, or compiler you are using.
John
If you don't want to mess with Windows APIs, I've had pretty good success by using the Fortran file system to signal between applications. When the application you want to check for starts, just have it open a file, write a single character to it, and then close it (STATUS='KEEP'). Other processes can check for the file's existence with an INQUIRE (FILE=...) and determine if the first application is operating. Of course, the monitored application needs to close and delete the file before it STOPs.
This method has the advantage of being portable and does not depend on the operating system, computer hardware, or compiler you are using.
John
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page