CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: process problem

  1. #1
    Join Date
    Feb 2006
    Posts
    2

    Question process problem

    Hi everybody,


    Here's my problem :

    I want to be able to show or hide a process window while it is running.

    Here is my code :

    Process p = null;

    p = new Process();
    p.StartInfo.WorkingDirectory = "c:\\Program Files\\Internet Explorer\\";
    p.StartInfo.FileName = "iexplore.exe";

    p.StartInfo.CreateNoWindow = true;
    p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

    p.Start();
    while (!p.HasExited)
    {
    Application.DoEvents();
    if (showProcess)
    {
    // Which code here ??
    }
    Thread.Sleep(100);
    }







    void button_showOrHideProcess_click (...)
    {
    showProcess = !showProcess;
    }




    obviously process.startInfo has no effect when process is already running, so how can I make window visible ?

  2. #2
    Join Date
    Jun 2005
    Posts
    121

    Re: process problem

    Hi,
    In order to make it visible you will have to use the Win32 API FindWindow method and once you have the handler to the IE window you should use SetForegroundWindow to bring it on top of all windows.

  3. #3
    Join Date
    Feb 2006
    Posts
    2

    Talking Re: process problem

    thanks I wll try this

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured