Click here to Skip to main content
15,911,141 members
Home / Discussions / C#
   

C#

 
AnswerRe: Telnet Client in C# Pin
Jared Parsons12-Dec-05 5:33
Jared Parsons12-Dec-05 5:33 
Questioncomponents, compoenet serviced and COM+ Pin
faviochilo12-Dec-05 4:12
faviochilo12-Dec-05 4:12 
Questionasp.net datagrid value grouping Pin
Dpriya12-Dec-05 3:23
Dpriya12-Dec-05 3:23 
AnswerRe: asp.net datagrid value grouping Pin
Drew McGhie12-Dec-05 4:46
Drew McGhie12-Dec-05 4:46 
QuestionModifying inbound HTML Pin
Sunil Shindekar12-Dec-05 2:55
Sunil Shindekar12-Dec-05 2:55 
AnswerRe: Modifying inbound HTML Pin
MarcelErz12-Dec-05 3:09
MarcelErz12-Dec-05 3:09 
GeneralRe: Modifying inbound HTML Pin
Sunil Shindekar13-Dec-05 3:35
Sunil Shindekar13-Dec-05 3:35 
GeneralRe: Modifying inbound HTML Pin
MarcelErz13-Dec-05 12:55
MarcelErz13-Dec-05 12:55 
Hi!

Here is an example to catch all running instances:

public void FindIE() {
// Retrieve list of all IE instances
SHDocVw.ShellWindows loIEs = New SHDocVw.ShellWindows();
SHDocVw.InternetExplorer loIE = null;

int llCount = 0;
mshtml.IHTMLDocument2 loDocument = null;

URLList.Items.Clear();
TitleList.Items.Clear();

IECountText.Text = loIEs.Count;

while(llCount <= loIEs.Count) {
loIE = loIEs.Item(llCount);
llCount++;

if (loIE != null) {
URLList.Items.Add(loIE.LocationURL);

loDocument = (mshtml.IHTMLDocument2)loIE.Document;
if (loDocument != null) {
TitleList.Items.Add(loDocument.title);
}
}
}
}

URLList -> List of all URLs open from instaces
TitleList -> List of all title tag data of all opened documents in the instances
IECountText -> Amount of Instances found

The "SHDocVw.ShellWindows" retrieve all instances of the IE. When every instance get created, it sign in to this list automatically, thats why you have an overview of all IE instances.
"SHDocVw.InternetExplorer" is one instance of an IE. With this, you can kinda do everything what you can do with the browser inside your application. Here an example of changing html of all instances:

public void ChangeAllIE() {
// Retrieve list of all IE instances
SHDocVw.ShellWindows loIEs = New SHDocVw.ShellWindows();
SHDocVw.InternetExplorer loIE = null;

int llCount = 0;
mshtml.IHTMLDocument2 loDocument = null;

URLList.Items.Clear();
TitleList.Items.Clear();

IECountText.Text = loIEs.Count;

while(llCount <= loIEs.Count) {
loIE = loIEs.Item(llCount);
llCount++;

if (loIE != null) {
URLList.Items.Add(loIE.LocationURL);

loDocument = (mshtml.IHTMLDocument2)loIE.Document;
if (loDocument != null) {
loDocument.clear();
loDocument.writeln((object)"Changed html!");
loDocument.close();
}
}
}
}

I hope it is clear so far and it works like I said, coz cannot check it at the moment! I will try it tomorrow morning, but I think it will work! If you need more help, just post it here!

Marcel Erz

P.S.: Plz try to understand the code, and not just copy it. The best way to learn is, to read and understand code!
GeneralRe: Modifying inbound HTML Pin
Sunil Shindekar19-Dec-05 2:30
Sunil Shindekar19-Dec-05 2:30 
GeneralRe: Modifying inbound HTML Pin
MarcelErz19-Dec-05 10:24
MarcelErz19-Dec-05 10:24 
GeneralRe: Modifying inbound HTML Pin
Sunil Shindekar2-Jan-06 0:55
Sunil Shindekar2-Jan-06 0:55 
QuestionControl does not redraw after loosing and regaining focus Pin
uGue12-Dec-05 2:35
uGue12-Dec-05 2:35 
AnswerRe: Control does not redraw after loosing and regaining focus Pin
Robert Rohde12-Dec-05 3:54
Robert Rohde12-Dec-05 3:54 
GeneralRe: Control does not redraw after loosing and regaining focus Pin
uGue12-Dec-05 5:34
uGue12-Dec-05 5:34 
QuestionWindows Form Pin
faisal khanani12-Dec-05 2:29
faisal khanani12-Dec-05 2:29 
AnswerRe: Windows Form Pin
uGue12-Dec-05 3:02
uGue12-Dec-05 3:02 
AnswerRe: Windows Form Pin
Polis Pilavas12-Dec-05 4:47
Polis Pilavas12-Dec-05 4:47 
GeneralRe: Windows Form Pin
faisal khanani12-Dec-05 18:14
faisal khanani12-Dec-05 18:14 
Questionload a .gif image at runtime in crystal report Pin
dhol12-Dec-05 2:01
dhol12-Dec-05 2:01 
QuestionRead .dif file format + store in dataser Pin
Darshan Gandhi12-Dec-05 1:36
Darshan Gandhi12-Dec-05 1:36 
AnswerRe: Read .dif file format + store in dataser Pin
Dave Kreskowiak12-Dec-05 6:21
mveDave Kreskowiak12-Dec-05 6:21 
QuestionImplement CheckBoxes in Listbox? Pin
MudkiSekhon12-Dec-05 1:27
MudkiSekhon12-Dec-05 1:27 
AnswerRe: Implement CheckBoxes in Listbox? Pin
Polis Pilavas12-Dec-05 2:29
Polis Pilavas12-Dec-05 2:29 
GeneralRe: Implement CheckBoxes in Listbox? Pin
MudkiSekhon12-Dec-05 2:40
MudkiSekhon12-Dec-05 2:40 
GeneralRe: Implement CheckBoxes in Listbox? Pin
Polis Pilavas12-Dec-05 4:41
Polis Pilavas12-Dec-05 4:41 

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.