views:

1654

answers:

1

I have IE8 add-on that needs to know command line arguments specified by user.

The problem is that real processes have command lines:

c:\program files\Internet Explorer\iexplore.exe SCODEF:5740 CREDAT:79873
c:\program files\Internet Explorer\iexplore.exe SCODEF:5740 CREDAT:79880

instead of

c:\program files\Internet Explorer\iexplore.exe www.yahoo.com
c:\program files\Internet Explorer\iexplore.exe www.google.com

So how can I get real arguments from add-on?

+1  A: 

In IE8, you cannot easily do this. The command line arguments are sent to the LCIE Frame process, and only the LCIE process information is passed to the LCIE Tab process. Any command line data is passed as flags to the tab process using shared memory.

To do what you ask, you'd need to look at the SCODEF command line parameter to find the process identifier of the hosting LCIE Frame process, then examine the command line of THAT process.

It might be helpful to understand why you want to do this at all.

EricLaw -MSFT-
1. Thank you for your ideas :-) 2. Why do I need this... My application starts IE with an add-on, and I needs to pass some parameters to this add-on. 3. You suggested to find parent process by SCODEF. This works for one instance, but if we have 5 instances, they all reference the same parent process, and as so only first instance command line can be read.
alex2k8
May be I can read data from shared memory? I guess CREDAT is used to identify it? Is there any information about this?
alex2k8
Attempting to read IE's internal structures isn't supported, and even if you figured out how to do it today, it would break later. You need to design your add-on such that the "read-the-command-line" requirement is removed.
EricLaw -MSFT-
Specifically, you could put your data in a shared location (e.g. registry, a file, etc) and have the add-on read it. Slightly hackier, you could start IE passing a custom URL that your add-on recognizes and acts upon. And so on.
EricLaw -MSFT-
Indeed, I can read the URL instead!
alex2k8