Can I load a webpage in TWebBrowser in a background thread?
When the application loads, I want to download the page from the Internet to TWebBrowser, but I do not want to block gui-thread.
Any suggestions?
Some clarifications:The webbrowser component lives on the form, and I want to display the page from the Internet. But I want to do the whole loading of this page in the background thread, so loading a heavy page will not block gui-thread.
I think I am able to write topics in general.
TWebBrowser . . , URL-, :
TWebBrowser
WebBrowser1.Navigate(...); while WebBrowser1.Busy do Application.ProcessMessages;
ProcessMessages, - . , , , OnNavigateComplete2. , , .
ProcessMessages
OnNavigateComplete2
, TWebBrowser , , , VCL. , TWebBrowser . Indy . .
( ), Rob. , . , .
, , :
while (webBrowser1.ReadyState <> READYSTATE_COMPLETE) do Application.ProcessMessages;
readystate :
const READYSTATE_UNINITIALIZED = 0; // Default initialisation state. const READYSTATE_LOADING = 1; // Object is currently loading data. const READYSTATE_LOADED = 2; // Object has been initialised. const READYSTATE_INTERACTIVE = 3; // User can interact with the object but loading has not yet finished. const READYSTATE_COMPLETE = 4; // All of the object data has been loaded.
readystate : http://gaskell.org/making-the-webbrowser-control-synchronous/
delphi readystate : http://www.cryer.co.uk/brian/delphi/twebbrowser/twebbrowser_properties.htm
, - , , .
, , , . Windows , . , TWebBrowser , -, .
Threading in COM STA, .
Source: https://habr.com/ru/post/1704652/More articles:Best way to use InputStream with respect to stability and XML - javaIs there something wrong with BitArrays in C #? - c #How to place resx files in App_GlobalResources folder using solutions (wsp)? - resourceshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1704650/aspnet-netmail-route-all-emails-to-a-different-email-address-in-debug-mode&usg=ALkJrhh4LgWL0iVb7C233Uc6_aNkkjevfgHow to efficiently send a large XML client to ASP.NET? - xmlCan I get IIS to add (inject) HTML to every page it serves? - iisHow to create url in servlet? - javaMocking CAL EventAggregator with Moq - .netUsing ObjectDataProvider - wpfExplain the query plan that sql server selects - sql-serverAll Articles