hello;
how to detect that outlook is installed in my computer
thank you
best regard
hello;
how to detect that outlook is installed in my computer
thank you
best regard
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Vaibhav Podutwar4 reputationPosted May 13, 2009, 3:54 AM EDT
Please check the link: http://www.eggheadcafe.com/tutorials/aspnet/cb972d77-0892-4bf7-834d-c23b6dd5c03a/c--get-the-all-running.aspx
If it doesn't work, Here is the code.
Complete C# code:
=============
using System;
using System.Collections.Generic;
using System.Text;
using System.Management;
using System.ComponentModel;
using System.Diagnostics;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
GetProcesses();
GetApplications();
Console.Read();
}
public static void GetProcesses()
{
StringBuilder sb = new StringBuilder();
ManagementClass MgmtClass = new ManagementClass("Win32_Process");
foreach (ManagementObject mo in MgmtClass.GetInstances())
Console.WriteLine("Name:" + mo["Name"] + "ID:" + mo["ProcessId"]);
Console.WriteLine();
}
public static void GetApplications()
{
StringBuilder sb = new StringBuilder();
foreach (Process p in Process.GetProcesses("."))
{
try
{
if (p.MainWindowTitle.Length > 0)
{
Console.WriteLine("Window Title:" + p.MainWindowTitle.ToString());
Console.WriteLine("Process Name:" + p.ProcessName.ToString());
Console.WriteLine("Window Handle:" + p.MainWindowHandle.ToString());
Console.WriteLine("Memory Allocation:" + p.PrivateMemorySize64.ToString());
}
}
catch { }
}
}
}
}
Example Output on my machine:
================
Name:System Idle ProcessID:0
Name:SystemID:4
Name:explorer.exeID:532
Name:smax4pnp.exeID:2880
Name:DVDLAU~1.EXEID:2580
Name:winampa.exeID:2140
Name:OUTLOOK.EXEID:9544
Name:ccSvcHst.exeID:30580
Name:ccApp.exeID:31680
Window Title:ConsoleApplication1 (Running) - Microsoft Visual Studio
Process Name:devenv
Window Handle:2558386
Memory Allocation:53194752
Window Title:Inbox - Microsoft Outlook
Process Name:OUTLOOK
Window Handle:7209408
Memory Allocation:40906752
Window Title:. Mozilla Firefox
Process Name:firefox
Window Handle:16515780
Memory Allocation:163573760
Posted May 13, 2009, 4:49 AM EDT
thank's but thy lack an (using reference)
Vaibhav Podutwar4 reputationPosted May 13, 2009, 6:03 AM EDT
Posted May 13, 2009, 7:38 AM EDT