Hello there.
I am trying to subclass Internet Explorer_Server Message but i got
some trouble. Let me give u some details.
I have a form Tform wich have a Twebbrowser inside this Twebbrowser is
aligned client and i want to know when the mouse is over it or not.
I already managed to do it with a hook but i think it's a bit heavy
because i send a message to my host form everytime the mouse move
I am trying to use something like this
once i got the handle to my Internet Explorer_Server i do
OldWindowProc := Pointer(SetWindowLong(IEHWND, GWL_WNDPROC,
LongInt(@NewWindowProc)));
then my window proc is
function NewWindowProc(WindowHandle : hWnd;
Message : LongInt;
ParamW : LongInt;
ParamL : LongInt) : LongInt stdcall;
begin
if (Message=WM_MOUSEMOVE) AND (mdhook=false) AND (MTCdrag=false) then
begin
if tmyform(extobj).opacity<255 then
begin
twidgetfrm(extobj).fadeout;
twidgetfrm(extobj).resetftimer;
end;
end;
if (Message=WM_LBUTTONDOWN) AND (MDHook=true) then
begin
Tmyform(extobj).hookedmd;
if MDcancel=true then
begin
result:=1;
exit;
end;
end;
Result := CallWindowProc(OldWindowProc, WindowHandle, Message,
ParamW, ParamL);
end;
mdhook,mtcdrag and extobj are defined below the implementation and
problem is seems to be shared by all my Twidgetfrm and of course it
create a bug.
extobj is a back reference to the form that host the webbrowser but it
always contain the last form created and then the opacity public
property is not the good one.
any idea how i can access private or public property withing new
windowproc ? i tried to define newwindowproc as a member of tmyform
but it does not compile
thx for ur help.