We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Why does Process.MainWindowTitle sometimes don't work ?

Thread ID:

Created:

Updated:

Platform:

Replies:

1794 Nov 26,2002 11:33 PM Apr 8,2003 11:32 PM Windows Forms 1
loading
Tags: FAQ
Timo von Niswandt
Asked On November 26, 2002 11:33 PM

Hello, I want to get informations about the title of processes on remote machines. On some machines (Win2000) the Method Process.GetProcesses() does return informations about running processes, but on some machines (WinNT) I get an exception. Furthermore the Method process.MainWindowTitle() does not return informations for remote processes. Here comes my code: Process process = null; foreach(Process proc in Process.GetProcesses("L1332020")){ MessageBox.Show(proc.ProcessName.ToString()); if(proc.MainWindowTitle.ToString().StartsWith("SessionB")){ process = proc; break; } } if(process==null) MessageBox.Show("No suitable Process found!"); else{ DKC_DllImport.BringWindowToTop (process.MainWindowHandle); DKC_DllImport.ShowWindow(process.MainWindowHandle, 9); //9 = SW_RESTORE } Does anybody have a solution for this problem that works ? Thanks, Timo

Administrator [Syncfusion]
Replied On April 8, 2003 11:32 PM

> Hello, > > I want to get informations about the title of processes on remote machines. On some machines (Win2000) the Method Process.GetProcesses() does return informations about running processes, but on some machines (WinNT) I get an exception. > > Furthermore the Method process.MainWindowTitle() does not return informations for remote processes. > > Here comes my code: > > Process process = null; > foreach(Process proc in Process.GetProcesses("L1332020")){ > MessageBox.Show(proc.ProcessName.ToString()); > if(proc.MainWindowTitle.ToString().StartsWith("SessionB")){ > process = proc; > break; > } > } > > if(process==null) > MessageBox.Show("No suitable Process found!"); > else{ > DKC_DllImport.BringWindowToTop (process.MainWindowHandle); > DKC_DllImport.ShowWindow(process.MainWindowHandle, 9); //9 = SW_RESTORE > } > > Does anybody have a solution for this problem that works ? > > Thanks, Timo

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;