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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:20:16+00:00 2026-05-24T10:20:16+00:00

Hi I have a new question for all fellow programmers to solve. Is there

  • 0

Hi I have a new question for all fellow programmers to solve. Is there a way that I can press a button or have a timer on that will fire an event that will make my app switch from one app to another? for example lets say I want to make a app that when i press a button it will switch from the current app to another app that is running like notepad or a game or something.

If there is a way to open a specific app by its name that would be great to, thanks.

PS: I already know how to code a timer so you don’t have to post one if you don’t want to.

  • 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-24T10:20:17+00:00Added an answer on May 24, 2026 at 10:20 am

    Using the two WinAPI functions FindWindow and SetFocus, you can achieve your desired goal:

    [DllImport("user32.dll")]
    static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
    
    [DllImport("user32.dll")]
    static extern IntPtr SetFocus(IntPtr hWnd);
    

    For example, to set a notepad window with the title “” to the foreground, you can use the following code:

    SetFocus(FindWindow("Notepad", "Untitled - Notepad"));
    

    If you don’t know the form’s name, then you can enumerate the windows using other WinAPI functions.


    Alternatively, you can use the Interaction.AppActivate() method from Microsoft.VisualBasic.dll, found in namespace Microsoft.VisualBasic if you reference it.

    Just simple call Interaction.AppActivate("window title") or Interaction.AppActivate(iPID).

    The appropriate documentation for this method can be found here.

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

Sidebar

Related Questions

I have a question about how to dynamically generate JTrees. Is there a way
Yet another TFrame IDE-registered-component question from me. Thanks for all the help, fellow programmers.
I have been asked to post a new question about how to correctly sort
I made a similar question a few days ago, but now I have new
Simple question. I have a new list and an old list. In Java is
Following on from my previous question [link text][1] , I have a new problem.
I have a question about using new[] . Imagine this: Object.SomeProperty = new[] {string1,
I am new to C and i have this question. why does the following
I'm new to postgreSQL and I have a simple question: I'm trying to create
I'm new to Java and I have a beginner question: NumberFormat is an abstract

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.