Yeah I thought about - checking all elements in the page for .ReadyState but I don't know how to do it :( Can you show me some code ??? (I check my prog on www.lenta.ru and this web page have 6 frames and 1 pop-up window) "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931)
Jasper4C
Posts
-
axWebBrowser DocumentComplete -
axWebBrowser DocumentCompleteHere you go the full (almost) source code
//Web browser settings this.webBrowser.AddressBar = false; this.webBrowser.Dock = DockStyle.Fill; this.webBrowser.FullScreen = true; this.webBrowser.MenuBar = false; this.webBrowser.Offline = false; this.webBrowser.RegisterAsBrowser = true; this.webBrowser.RegisterAsDropTarget = false; this.webBrowser.Silent = true; this.webBrowser.StatusBar = false; this.webBrowser.TheaterMode = true; . . . private void webBrowser_DocumentComplete (object sender,AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent e) { //Test counter - to see how many times this event rised ++this.tempCounter; if ( sender.Equals((object)this.webBrowser) && this.webBrowser.ReadyState.Equals(SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE)) { MessageBox.Show ("Done loading\n\nLoaded " + this.tempCounter.ToString() +" times", "Document loaded"); //Receive global Document htmlDocGlobal = (mshtml.IHTMLDocument2) webBrowser.Document; if (clickEvent == null) { //Hook the event if not hooked till now clickEvent = (mshtml.HTMLDocumentEvents2_Event) htmlDocGlobal; clickEvent.onclick += new mshtml.HTMLDocumentEvents2_onclickEventHandler (On_MouseClick); } } //else // { still loading } } //This function will rise when the user click's on web browser web page private bool On_MouseClick (mshtml.IHTMLEventObj e) { if (e.button.Equals (0)) { //Left-click mouse ArrayList m_PathToElement = new ArrayList(); IHTMLElement m_Parent = null; IHTMLElement m_Child = null; IHTMLElementCollection m_ParentCol = null; IEnumerator colEnum = null; //Receive pre-conditions m_Child = e.srcElement; //TEST_DEBUG: Child element may not have Parent elements !!! m_Parent = m_Child.parentElement; while (m_Child.parentElement != null) //if this is not the root element { { //Get the collection m_ParentCol = (IHTMLElementCollection) m_Parent.all; System.Windows.Forms.Application.DoEvents (); //let the system copy it colEnum = m_ParentCol.GetEnumerator (); colEnum.MoveNext (); //reset to '0' . . . . . Then I go throught collection and search for ckicked element till the root element. } } }
I make some checks for received htmlDocGlobal and the size is different all the time :(( If you need the full source code please contact me by eMail "I have not failed. I've just found 10,000 ways that won't work." - Thomas -
axWebBrowser DocumentCompleteHi man !! Thanks for the answer - very helpfull. But you see - I'm still having problems with determinate when exactly web page is loaded :( I'm trying to receive IHTMLCollection from axWebBrowser.Document from some news web site (the url is http://www.lenta.ru) For the very bad luck I choosed this site to test my collection with and I still receive a weird result :(( Sometimes the size of collection is 2069 elements and sometimes (I just hit refresh button I receive collection of 2065 (!) elements and so on... I don't know what to do :( Seems to me I can't really lock on the page and some elements are missing (?) sometimes ??? Any sugestions ??? "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931)
-
axWebBrowser DocumentCompleteHi ! I need to know when my axWebBrowser finished the navigation to the web page. I hooked to .DoumentComplete event but it turns out that this event happens more than 1 time !?? (Why ?) So - how I can tell when the web page is completly loaded ?? "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931)
-
New file new tabThank you "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931)
-
New file new tabHi ppl! May be this is old question and someone asked this already (if so please redirect me to the answer) if no: Every time I clicked on file in solution explorer the file (source code) is opens and replace the current file that I working with (this ocurs when I'm not editing the file - there's no * in file name at tab) -so the question is: How I can make VS to open any file on the NEW tab and not (!) to replace open tabs even if I not editing the current file ??? 10x "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931)
-
axWebBrowser DocumentCompleteHi ppl! In my program I need to catch the axWebBrowser1 'DocumentComplete' event. But I find out that this event happens more than 1 times !!!?? At some pages it even happens 7 or 8 times !! Why is this ??? And how I can tell if this is very last chance when it happens (document completly loaded) or there's will be more 'DocumentComplete' events ??? Please help - this is extremly important to me "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931)
-
Serialization problemHi ppl! May be you can help me with this: I have some collection inside collection of my classes and I need to serialize it. The tree looks like this: class NewsSourceCollection : CollectionBase, ISerializable { //This class is a main class and generally will hold all the data and List's void Add (NewsSourceSingle in_param) { this.List.Add(new NewsSourceSingle(in_param)); } void RemoveAt (int index) { this.List.RemoveAt(index); } void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { //Question number 1: How I can serialize a List from System.Collection ??? } private newsSourcesColllection(SerializationInfo info, StreamingContext context) { //Here goes deserialization } } //class close class NewsSourceSingle : ISerializable { //This class will be used by NewsSourceCollection to Add or Remove from List and hold instance of NewsItemsCollection class to add some sub items there private NewsItemsCollection m_ns; public NewsSourceSingle () { //c'tor this.m_ns = new NewsItemsCollection (); } void Add(some_param) { this.m_s.Add(some_param); } . . . . +same functions to support ISerializable } class NewsItemsCollection : CollectionBase, ISerializable { //This class will hold all collection of NewsItems +the same function for supporing ISerializable }//class close class NewsItems : ISerializable { string pp; string dd; +same functions to support ISerializable } class close Question number 2: I can Formatter.Serialize (stream,object) but I can not (!) deserialize it !! Why ? Because Assembly of my type 'NewsProg version=1.0.9.245 Token....' is not found !!????? Question 3: How can I serialize List (of System.Collection) ?? "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931)
-
MultyThreading in C#: Communication between threads10x for information but what I mean was - for example: -------------------------------------------------------- using .... ; //doesn't matter namespace DllClass { public class ClassA { private string m_message; public ClassA() { //Empty constr (??) } public void ThreadEntrancePoint() { //This method will be called when creating //a new thread //TODO: Should I put here infinity loop ??? } //This method will chande variable in this class public string SetMessage { set { if (value != null) m_message = value; } } } } // End of DLL file --------------------------------------------------------- using ....; //All the other using System.Threading; using DllClass; //need to create class namespace MyFormNameSpace { public class MyForm: Windows.Form { public int Main (...) { //Doesn't matter for now } //This function will be called when user want's //to create a new thread public void btn_CreateThread(...) { Thread t = new Thread (new ThreadStart DllClass.ClassA.ThreadEntrancePoint); t.Start(); } //This function will be called when user want //to send a new messge to the class that inside //thread public void SendNewMessageToThread (string msg) { //TODO: What code should I put here to send //message to ClassA.SetMessage ?? } }//class close }//namespace close --------------------------------------------------------- You see - in this example I want to completly run ClassA in new thread and also pass some variables to this class and may be receive some inforamtion from it. How I can do that ? "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931)
-
MultyThreading in C#: Communication between threadsHi! May be yo can help me with this problem: I need to create a new instance of class (DLL or Windows Class file) that part of the project in a separate thread. Then I need to communicate with that class by passing some varibales or calling function/methods in this class. So question is: How I can do that (with multythreading) ? I appreciate if you write me some code too - thanks "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931)
-
Opening a form inside anotherYou can somehow set ID numbers to the buttons on your toolbar and then catch every event from this button or something like this private void button1_click (la la la ..) { ContractListForm frm1 = new ContractListForm(); this.Hide(); frm1.Show(); } "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931)
-
Multy form questionNice.. 10x [Do you know how to make form transperent / non-standart shape ?] "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931)
-
Multy form questionBut in this case I have to make progressBar1 on Form2 - static !
public **static** ProgressBar progressBar1;
otherwise I can not see it :( "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931) -
Multy form questionLike this ?
//on Form 1 Form frm2 = new MyNamespace.Form2(); frm2.Show(); ++frm2.progressBar1.value;
This is what you mean ? "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931) -
Multy form questionCan someone help me with multy form communication ? The question is: If I have 2,3,more... forms visible how can form number 1 send some data (for exmaple: move progress bar) on Form number 2,3,4,more... ?? Sending varibales from one form to another,sharing resources and stuff ?? :laugh: "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931)
-
html to image componentNever saw this on work :( Sorry - once I've searched the net for this info and this what I found. Never used it and didn't know if this work. P.S. This is strange that some interfaces (!!!) doesn't work somewhere :(( May be it's depends on browser version ?? "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931)
-
html to image componenttry to start search from here: Thumbnail Generator Web Service Description: The Thumbnail Generator Web Service creates a .gif image of a specified URL.
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=836c770f-89eb-4041-ba7c-ff870a57cca1 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/iextractimage/iextractimage.asp
Found from here:http://www.gotdotnet.com/community/messageboard/Thread.aspx?id=75039&Page=1#75057
"I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931) -
HTML editor in C#10x man !! But I already found the answer. Some sites to look for: http://abstractvb.com/code.asp?P=1&F=51 [VB site] Google.com [try to search for every interface name you found or question about - it's really helps] "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931)
-
HTML editor in C#Can you help me with a good, from ground up, with pictures and links tutorial - how I can edit HTML document from inside C# ? I readed MSDN articles about MSHTML editing but I'm still have some questions "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931)
-
Edit MSHTML Document in C#I'm very new into this field - so may be someone can help me 1) How I can receive html page from internet (this part I know but if you know some tricks..) 2) Edit this with mshtml Document 3) Show changed document again You see - the problem is that I searched the MSDN and fins a lot of topics how to edit and how to receive page from the insternet but the question is: if I edit the mshtml document How I can see the changes ?? "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931)