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

  • Home
  • SEARCH
  • 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 8327285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:03:37+00:00 2026-06-09T01:03:37+00:00

I think starting a process minimized should be simple but I had no luck

  • 0

I think starting a process minimized should be simple but I had no luck with outlook. How can I start Outlook minimized?

My attempt was this:

[DllImport("user32.dll")]
private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);

static void Main(string[] args)
{
    ProcessStartInfo startInfo = new ProcessStartInfo();
    startInfo.FileName = "OUTLOOK.EXE";

    IntPtr hWnd = Process.Start(startInfo).Handle;

    bool state = false;
    if (!hWnd.Equals(IntPtr.Zero))
        state = ShowWindowAsync(hWnd, 2);

    // window values: http://msdn.microsoft.com/en-us/library/windows/desktop/ms633548(v=vs.85).aspx

    Console.WriteLine(state.ToString());
    Console.Read();
}
  • 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-06-09T01:03:39+00:00Added an answer on June 9, 2026 at 1:03 am

    I have solved it but I like to hear your comments if you think the solution can be improved.
    I also have posted the solution on my blog with some more details at http://jwillmer.de/blog/2012/08/01/how-to-start-outlook-minimized-with-c/

    [DllImport("user32.dll")]
    private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
    
    // console application entry point
    static void Main()
    {
        // check if process already runs, otherwise start it
        if(Process.GetProcessesByName("OUTLOOK").Count().Equals(0))
            Process.Start("OUTLOOK");
    
        // get running process
        var process = Process.GetProcessesByName("OUTLOOK").First();
    
        // as long as the process is active
        while (!process.HasExited)
        {
            // title equals string.Empty as long as outlook is minimized
            // title starts with "öffnen" (engl: opening) as long as the programm is loading
            string title = Process.GetProcessById(process.Id).MainWindowTitle;
    
            // "posteingang" is german for inbox
            if (title.ToLower().StartsWith("posteingang"))
            {
                // minimize outlook and end the loop
                ShowWindowAsync(Process.GetProcessById(process.Id).MainWindowHandle, 2);
                break;
            }
    
            //wait awhile
            Thread.Sleep(100);
    
            // place for another exit condition for example: loop running > 1min
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Heads starting to hurt. I think I dropped into this too fast... Perhaps someone
First of all, I reviewed this question , but I think I need a
I'm in the process of starting to build a strategy game (think warcraft) for
I don't think this is an exact duplicate of other questions, but feel free
I think this is an issue with which version of NodeJS I'm using, but
Good afternoon, I am currently starting to think & prototype about a (.net based)
Im starting with CoCos2d development and I think I have some issues with nodespace,
I am trying to do an unfold - (I think), by starting with an
I'm a starting C/C++ programmer. What I want is the following thing: Start program,
First, thank you for reading this. I am just starting php and I am

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.