Activate other process

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bsiang Tan

    #1

    Activate other process

    Is there any way to activate or bring the process to front ?
    For example, my application will run the windows calculator. After certain
    process, I will need to activate the calculator...

    I know how to runthe windows calculator..
    is Process.Start(" calc.exe")

    but when I wish to activate the it, I have no idea..
    I know there is a function AppActivate( ) in VB..
    is there any equivalent function in C# ?
    Thank a lot ~

    Best regard,
    Bsiang


  • Andrew Gnenny

    #2
    Re: Activate other process

    Hi,
    You can use such approach:
    1. Get Process class instance returned by Process.Start
    2. Query Process.MainWin dowHandle
    3. Call unmanaged Win32 API function "ShowWindow " or "SwitchToThisWi ndow"
    --
    Andrew Gnenny
    pulsar2003@/no-spam/email.ru (Please remove /no-spam/ for reply)
    X-Unity Test Studio

    Bring the power of unit testing to VS .NET IDE


    "Bsiang Tan" <tbsiang1982@ho tmail.com> wrote in message
    news:OVCVcuQnDH A.2500@TK2MSFTN GP10.phx.gbl...[color=blue]
    > Is there any way to activate or bring the process to front ?
    > For example, my application will run the windows calculator. After certain
    > process, I will need to activate the calculator...
    >
    > I know how to runthe windows calculator..
    > is Process.Start(" calc.exe")
    >
    > but when I wish to activate the it, I have no idea..
    > I know there is a function AppActivate( ) in VB..
    > is there any equivalent function in C# ?
    > Thank a lot ~
    >
    > Best regard,
    > Bsiang
    >
    >[/color]


    Comment

    Working...