Paula Mansour

how can I cast -Convert-

from

Process IEProcess

to

SHDocVw.InternetExplorer

in other words I want do the folowing BUT it gives me exeption -can't cast-

SHDocVw.InternetExplorer iex = (SHDocVw.InternetExplorerClass)IEProcess;

after i monitor the current processes "I did it" and know that it's internet explore process

now i monitor it using SHDocVw.InternetExplorer

how can i do it

thanks for your help




Re: Internet Explorer Extension Development how can I cast Process to SHDocVw.InternetExplorer ?

Paula Mansour

OK is it impossible to done !!!

okay I wqant do other thing will be istead of it

I want know when internet explorer is opened - I want imiteadly know that -

BUT using SHDocVw.InternetExplorer NOT Process

the following code do it but using process :::

/**************************************************************************************************************/

public void StartWatch()

{

WqlEventQuery query = new WqlEventQuery("__InstanceCreationEvent", new TimeSpan(0, 0, 1), "TargetInstance isa \"Win32_Process\"");

watcher = new ManagementEventWatcher();

watcher.Query = query;

getDefaultBrowser();

string ep;

do

{

ManagementBaseObject e = watcher.WaitForNextEvent();

ep=((ManagementBaseObject)e["TargetInstance"])["Name"].ToString();

if (ep == "iexplore.exe" )

{

Process pr = Process.GetProcessById(int.Parse(((ManagementBaseObject)e["TargetInstance"])["Processid"].ToString()));

// The process pr now is the internet explorer just obent

// I want convert it to SHDocVw.InternetExplorer

// to be access on ie as i want

}

} while (true);

}

/**************************************************************************************************************/

The other way i need to watch just internet explorer as the previous code da but using SHDocVw.InternetExplorer

how

/**************************************************************************************************************/






Re: Internet Explorer Extension Development how can I cast Process to SHDocVw.InternetExplorer ?

Paula Mansour

up