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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Posted May 13, 2009, 11:38 AM
Vaibhav PodutwarPosted May 13, 2009, 10:03 AM
Posted May 13, 2009, 8:49 AM
thank's but thy lack an (using reference)
Vaibhav PodutwarPosted May 13, 2009, 7:54 AM
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