Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 467581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:35:46+00:00 2026-05-12T23:35:46+00:00

I have a program written in foxpro (~shudder~) that I’ve inherited. The issue is,

  • 0

I have a program written in foxpro (~shudder~) that I’ve inherited.

The issue is, it has some COM controls in it. When you start 2 copies, the second copy will throw errors. So I thought, this could be cleaned up to bring the active copy to the front allowing only a single instance.

That would be fine, but the program takes a command line parameter allowing it to be run in a different mode. You can only have one copy running in each mode e.g.

1)

"program /bos"   
"program /pos"  = OK

2)

"program /pos"
"program /pos"  = NOT OK

What I’d like is this

"program /pos"
"program /pos" - Bring currently running pos instance to the front.

"program /bos" - start a BOS instance.
"program /bos" - bring the bos instance to the front.

I hope that makes sense. What is an elegant way to determine whether the running instance of program is in pos or bos mode so I can determine which process to bring to the front or whether to start a fresh copy in the requested mode.

I don’t necessarily need foxpro code here – although that would be nice. The concept is what I’m after and some hints in regards to the windows API functions to achieve it would also be of help. e.g. can you determine the command line options of a running process?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T23:35:47+00:00Added an answer on May 12, 2026 at 11:35 pm

    A named mutex will do exactly what you need. If you did want to see the command line for all visible processes, though, and you were targeting Windows XP or later you could use WMI: WIN32_Process has a CommandLine property which was introduced in XP / Server 2003.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program written in C that has to input and output JSON
I have a program written in VB that has DataDynamics ActiveReports as well as
I have a program written in VB.Net (Visual Studio 2008) that uses a DLL
I have a client program written in .NET 2.0, that connects to the web
I have a program that is written in Ada, and I need to compile
I have written a program that uses qhttp to get a webpage. This works
I have written this program, which sorts some ints using a functor: #include<iostream> #include<list>
I have a program written in C++, that opens a binary file(test.bin), reads it
I have a program written in c that I compiled (The project structure is
I have a program written in c that gets invoked like: my_program arg1 arg2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.