Click here to Skip to main content
15,891,529 members
Home / Discussions / C#
   

C#

 
QuestionRemoving a duplicate row C# and WMI Pin
Buck_Murdock25-Mar-09 10:57
Buck_Murdock25-Mar-09 10:57 
QuestionAnybody here handle what happens when you unplug a USB based Serial Port? Pin
Wes Jones25-Mar-09 10:26
Wes Jones25-Mar-09 10:26 
AnswerRe: Anybody here handle what happens when you unplug a USB based Serial Port? Pin
Henry Minute25-Mar-09 10:52
Henry Minute25-Mar-09 10:52 
GeneralRe: Anybody here handle what happens when you unplug a USB based Serial Port? Pin
Wes Jones25-Mar-09 11:04
Wes Jones25-Mar-09 11:04 
GeneralRe: Anybody here handle what happens when you unplug a USB based Serial Port? Pin
Henry Minute25-Mar-09 11:15
Henry Minute25-Mar-09 11:15 
GeneralRe: Anybody here handle what happens when you unplug a USB based Serial Port? Pin
DaveyM6925-Mar-09 11:19
professionalDaveyM6925-Mar-09 11:19 
GeneralRe: Anybody here handle what happens when you unplug a USB based Serial Port? Pin
Luc Pattyn25-Mar-09 13:36
sitebuilderLuc Pattyn25-Mar-09 13:36 
GeneralRe: Anybody here handle what happens when you unplug a USB based Serial Port? Pin
Colin Angus Mackay25-Mar-09 14:48
Colin Angus Mackay25-Mar-09 14:48 
GeneralRe: Anybody here handle what happens when you unplug a USB based Serial Port? Pin
Wes Jones25-Mar-09 15:34
Wes Jones25-Mar-09 15:34 
AnswerRe: Anybody here handle what happens when you unplug a USB based Serial Port? Pin
Henry Minute25-Mar-09 11:41
Henry Minute25-Mar-09 11:41 
GeneralRe: Anybody here handle what happens when you unplug a USB based Serial Port? Pin
DaveyM6925-Mar-09 11:43
professionalDaveyM6925-Mar-09 11:43 
QuestionStreamWriter help... Pin
VoodooInfinity25-Mar-09 10:07
VoodooInfinity25-Mar-09 10:07 
AnswerRe: StreamWriter help... Pin
BOMBONEW25-Mar-09 10:14
BOMBONEW25-Mar-09 10:14 
GeneralRe: StreamWriter help... [modified] Pin
VoodooInfinity25-Mar-09 10:23
VoodooInfinity25-Mar-09 10:23 
AnswerRe: StreamWriter help... Pin
J$25-Mar-09 10:34
J$25-Mar-09 10:34 
AnswerRe: StreamWriter help... Pin
Ian Shlasko25-Mar-09 10:34
Ian Shlasko25-Mar-09 10:34 
QuestionC# and Data Acquisition Application Pin
stancrm25-Mar-09 10:06
stancrm25-Mar-09 10:06 
JokeRe: C# and Data Acquisition Application Pin
Eddy Vluggen25-Mar-09 10:31
professionalEddy Vluggen25-Mar-09 10:31 
AnswerRe: C# and Data Acquisition Application Pin
DaveyM6925-Mar-09 11:26
professionalDaveyM6925-Mar-09 11:26 
GeneralRe: C# and Data Acquisition Application Pin
Eddy Vluggen25-Mar-09 12:07
professionalEddy Vluggen25-Mar-09 12:07 
GeneralRe: C# and Data Acquisition Application Pin
DaveyM6925-Mar-09 12:17
professionalDaveyM6925-Mar-09 12:17 
AnswerRe: C# and Data Acquisition Application Pin
Luc Pattyn25-Mar-09 13:47
sitebuilderLuc Pattyn25-Mar-09 13:47 
QuestionKill a process in RDC session Pin
pranu_1325-Mar-09 9:48
pranu_1325-Mar-09 9:48 
AnswerRe: Kill a process in RDC session Pin
Ian Shlasko25-Mar-09 10:43
Ian Shlasko25-Mar-09 10:43 
GeneralRe: Kill a process in RDC session Pin
pranu_1325-Mar-09 12:21
pranu_1325-Mar-09 12:21 
The context in which i close the application i cannot maintain the instance. Thanks for the response.

I found a solution. Check below:

[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr FindWindow(string sClassName, string sWindowTitle);

[DllImport("user32.dll")]
static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);

uint processId;
IntPtr hProgram = WebApp.FindWindow(null, ".....");
GetWindowThreadProcessId(hProgram , out processId);
System.Diagnostics.Process.GetProcessById((int)processId).Kill();

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.