Add
Macromedia Flash Resizing - A easy way
The Problem: - I lost some time searching about the control donīt receive any notification about changes that modify itself. The fact is that, after it was dropped in a form or any parent control, it loses the perception of any changes made, because it expect that the parent send this message to him (Using some OLE methodīs). - Starting at the concept that "when the control is created at runtime it obey the first shape" i looked for a malfunction in one CreateWindow function call. Voila! The Solution: - Overriding the resize method of TControl i could redefine the parent to nil and back. It force the TOleControl to notify the Activex that something was changed and Activex properly reply to event! The Code: - After importing the Flash Control (SWFLASH.OCX) to a Delphi unit you can apply this patch: //-- Begin -- {Shockwave Control} TShockwaveFlash = class(TOleControl) private ... protected ... {Resize Error Workaround} procedure Resize; override; ... end; {Implementation} procedure TShockwaveFlash.Resize; var SavedParent: TWinControl; begin {Sync flash bounds after any move} SavedParent := Parent; Try Parent := nil; inherited; finally Parent := SavedParent; end; end; //--End You can download the unit shockwav.pas to read more about this! Obs: Donīt press Ctrl+Shft+C at TShockwaveFlash to use Class Completion to declare the implementation for you! It will redefine a large number procedure that are inherited of TOleControl and donīt exists at this time! So write it manualy!!!! The End: - I hope that it was usefull to something!!!
Related Discussions
|
Latest News
Latest Forum Entries
|