Navigate2
is an asynchronous operation. By following it with Refresh
, you're not giving the navigation a chance to start and fire BeforeNavigate2
event. Perhaps, you should wait for NavigateComplete2
to get fired, before calling Refresh
. What exactly are you trying to achieve? The bug you refer to is not related to your Delphi code, it was specific to .NET and got fixed long ago.
[EDITED]. What I said above was incorrect. It might have been true for IE7, but for IE10, both BeforeNavigate2
and NavigateComplete2
do get fired (once), even if Navigate
call is immediately followed with Refresh
. However, that doesn't trigger OLECMDID_PREREFRESH
or OLECMDID_REFRESH
commands to be sent by WebBrowser control to its site COM object. I only saw OLECMDID_PREREFRESH
coming through when I manually triggered a refresh via right-click menu (but still no OLECMDID_REFRESH
). This has been verified with C++/ATL/VS2012. Unfortunately, this doesn't help to answer why the behavior is different with Delphi.