bsalsa - Delphi tips, tricks, code snippets,Samples Component Search Engine.

The current search engine database includes about 5000 Delphi web sites and growing...

By pressing the button, you can add the Search engine to your iGoogle. Add to Google


Go Back   EmbeddedWB - bsalsa forum > General Category > Known Bugs / Fixed Bugs > Fixed Bugs
Register FAQDonate Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 03-04-2010, 01:43 PM   #1
AHUser
Coder
 
Join Date: Jan 2009
Posts: 3
IE Control Handle is not destroyed correctly

With the changes in TCustomEmbeddedWB.CreateWnd/DestroyWnd (that keep the content of the webbrowser after a recreate) it is possible to incorrectly destroy the webbrowser.

Code:
type
  TWinControlCracker = class(TWinControl);

begin
  TWinControlCracker(EmbeddedWb1).DestroyHandle; // Handle=0
  // ...
  EmbeddedWb1.Free; // Because Handle=0 => WM_DESTROY is not handled correctly
end;
This is no big problem especially because it is a corner case. But to correctly destroy the webbrowser in this example the attached patch adds code to TCustomEmbeddedWB.Destroy that will restore the Handle if CurrentHandle is still valid, thus the inherited Destroy can correctly destroy the window handle.
Attached Files
File Type: zip EwbCore.pas.patch.zip (617 Bytes, 4 views)
AHUser is offline   Reply With Quote
Old 07-25-2010, 11:42 AM   #2
smot
Main Developer
 
smot's Avatar
 
Join Date: May 2006
Posts: 911
Thanks, I applied the patch
smot is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT +3. The time now is 04:51 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
bsalsa@gmail.com