Hi,
I am trying to determine which form in a multiform has got focus;
I have a timer in each form that detects for a mouse up / down and acts upon it; only if that form is the active one ( ie the form caption is Active).
form2.mousetimertimer(sender :tobject);
begin
IsMOuseUp:=getkeystate(vk_lbutton) and $8000=0; // detects if the mouse is up
if ((ismmouseup) and (form2.focused)) then
begin
// do something
// testing show hide button
button1.visible:=not button1.visible;
end;
end;
The above should if I have it correct only toggle the visibilty when form2 is active;
However it is toggling the button even when form1 is the active 1.
Is there another way to detect which form is the active one?