Click here to Skip to main content
15,914,419 members
Home / Discussions / C#
   

C#

 
GeneralRe: BeginInit() and EndIinit() performance Pin
DavidNohejl1-Jun-07 2:07
DavidNohejl1-Jun-07 2:07 
GeneralRe: BeginInit() and EndIinit() performance Pin
Martin#1-Jun-07 8:17
Martin#1-Jun-07 8:17 
GeneralRe: BeginInit() and EndIinit() performance Pin
Dave Kreskowiak1-Jun-07 4:32
mveDave Kreskowiak1-Jun-07 4:32 
GeneralRe: BeginInit() and EndIinit() performance Pin
Martin#1-Jun-07 8:17
Martin#1-Jun-07 8:17 
QuestionWebRequest Pin
TAREQ F ABUZUHRI31-May-07 21:01
TAREQ F ABUZUHRI31-May-07 21:01 
AnswerRe: WebRequest Pin
blackjack215031-May-07 21:37
blackjack215031-May-07 21:37 
QuestionSwitch to process Pin
Cliffer31-May-07 20:42
Cliffer31-May-07 20:42 
AnswerRe: Switch to process Pin
Martin#31-May-07 20:54
Martin#31-May-07 20:54 
Hello,

You could use the MainWindowHandle property of the process in combination with BringWindowtoTop method of user32.dll.

[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern int BringWindowToTop(IntPtr hwnd);
public IntPtr HWND_TOPMOST =(IntPtr)(-1);
public IntPtr HWND_NOTOPMOST =(IntPtr)(-2);
//Your method
    System.Diagnostics.ProcessStartInfo psi;
    psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;
    psi.FileName = "???.exe";
    using(System.Diagnostics.Process process = new System.Diagnostics.Process())
    {
        process.Start(psi);
        process.WaitForInputIdle(); 
        BringWindowToTop(process.Handle);
    }    


I'm using this in .Net1.1, maybe in .Net 2.0 there is a more elegant way.

Hope it helps!

All the best,

Martin
QuestionRe: Switch to process Pin
Cliffer31-May-07 21:06
Cliffer31-May-07 21:06 
QuestionControlling Keyboard through..... Pin
Vivek Vijayan31-May-07 20:32
Vivek Vijayan31-May-07 20:32 
GeneralRe: Controlling Keyboard through..... Pin
Martin#31-May-07 20:47
Martin#31-May-07 20:47 
GeneralRe: Controlling Keyboard through..... Pin
Vivek Vijayan31-May-07 22:51
Vivek Vijayan31-May-07 22:51 
GeneralRe: Controlling Keyboard through..... Pin
Martin#31-May-07 22:58
Martin#31-May-07 22:58 
GeneralRe: Controlling Keyboard through..... Pin
Vivek Vijayan31-May-07 23:13
Vivek Vijayan31-May-07 23:13 
GeneralRe: Controlling Keyboard through..... Pin
Martin#31-May-07 23:18
Martin#31-May-07 23:18 
GeneralRe: Controlling Keyboard through..... Pin
Luc Pattyn31-May-07 23:24
sitebuilderLuc Pattyn31-May-07 23:24 
GeneralRe: Controlling Keyboard through..... Pin
Vivek Vijayan31-May-07 23:36
Vivek Vijayan31-May-07 23:36 
GeneralRe: Controlling Keyboard through..... Pin
Martin#31-May-07 23:43
Martin#31-May-07 23:43 
GeneralRe: Controlling Keyboard through..... Pin
Vivek Vijayan31-May-07 23:57
Vivek Vijayan31-May-07 23:57 
GeneralRe: Controlling Keyboard through..... Pin
Martin#1-Jun-07 0:06
Martin#1-Jun-07 0:06 
JokeRe: Controlling Keyboard through..... Pin
ScottM11-Jun-07 0:28
ScottM11-Jun-07 0:28 
JokeRe: Controlling Keyboard through..... Pin
Martin#1-Jun-07 0:34
Martin#1-Jun-07 0:34 
GeneralRe: Controlling Keyboard through..... Pin
Vivek Vijayan1-Jun-07 6:20
Vivek Vijayan1-Jun-07 6:20 
GeneralRe: Controlling Keyboard through..... Pin
Martin#1-Jun-07 8:19
Martin#1-Jun-07 8:19 
GeneralRe: Controlling Keyboard through..... Pin
Vivek Vijayan1-Jun-07 20:57
Vivek Vijayan1-Jun-07 20:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.