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 730509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:55:13+00:00 2026-05-14T06:55:13+00:00

We only want one instance of our app running at any one time. So

  • 0

We only want one instance of our app running at any one time. So on start up it looks to see if the app is running and if it is, it calls SetForegroundWindow on the Main Window.

This is all good and well … for the most part..

When our app starts up it will show a Splash screen and a Logon form. Both of these forms have ShowInTaskBar = false.

Because of this, if you try to start up another copy of the app when the Logon form is showing, that Logon form is not brought to the front!

Especially as the user cant see anything in the taskbar as well, all they figure is that the app is duff and cannot start. There is no indication that there is another instance running.

Is there any way around this problem?

  • 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-14T06:55:13+00:00Added an answer on May 14, 2026 at 6:55 am

    Well, code is here. Even if the ShowInTaskBar is false, you should be able to bring it to the front.

        [DllImport("USER32.DLL", CharSet = CharSet.Unicode)]
        public static extern IntPtr FindWindow(String lpClassName, String lpWindowName);
    
        [DllImport("USER32.DLL")]
        public static extern bool SetForegroundWindow(IntPtr hWnd);
    
        public static void bringToFront(string title) {
            // Get a handle to the Calculator application.
            IntPtr handle = FindWindow(null, title);
    
            // Verify that Calculator is a running process.
            if (handle == IntPtr.Zero) {
                return;
            }
    
            // Make Calculator the foreground application
            SetForegroundWindow(handle);
        }
    

    Note: you should FindWindow using the form’s class and not by name as the splash screen forms sometimes do not have titles or even the controlbox. Use Spy++ to dig deeper.

    Use FindWindow on splash. I think this is what you want to do – bring the splash screen in front while loading of the main form.

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

Sidebar

Related Questions

I want to save a query only one time in the database, this is
If I've got a Ruby program, and I only want one instance of it
i have a page that contains several submit buttons however i only want one
Play with it here: http://jsbin.com/ocicu4/4/edit Simple Accordion, I only want one section open at
I have multiple radiobutton lists within a fieldset tag. I only ever want one
So in the interest of not repeating myself, I only want to create one
I have a several processes node.js. I want to only add one string to
I have a two UIViews filled with UIButtons. I want to only allow one
I want to select only one radio button but I cant do this. Here
I want to merge this queries into only one, to return 2 values (scount_atp

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.