I wrote a component a while ago and recently found it again. It's for making forms transparent in a manner that allows a PNG image to be placed over it and still both retain their transparency. This is much nicer than the transparency that current windows os's offer as it's a simple on or off state for that. This way I can place a gradiated alpha image on a form and it sits nice and smoothly over whatever's behind the form.
The problem with it is that if I bring another application over my form and then minimize it (rather than click on my form or alt-tab to it etc.) then I can still see the contents of the now minimized window. In short - a refresh or repaint is being triggered when I bring to the application to the front, but not when it becomes the topmost through another application being minimzed.
I'd like to stop this happening.
Thanks in advance,
Here's the component code.....
uses WinTypes, WinProcs, Messages, SysUtils, Classes, Controls,
TClearForm = class(TComponent)
procedure Loaded; override;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
MainForm : TForm;
WndProc : Integer;
OldWndProc : Integer;
function HookProc(Hwnd, Msg, WParam, LParam: Integer): Integer; Stdcall;
If Msg<>WM_ERASEBKGND then
Result:=CallWindowProc(Pointer(OldWndProc), Hwnd, Msg, WParam, LParam);
If Not (csDesigning in ComponentState) then
OldWndProc:=SetWindowLong(MainForm.Handle, GWL_WNDPROC, Integer(@HookProc));
constructor TClearForm.Create(AOwner: TComponent);