-
Hi,
Today I recompiled my TinyResMeter tool with fresh 3.15, and as it was an update from rather old KOL&MCK version, it showed me a warning about new KOLTabs, so I had to manually delete the old ones as explained by the warning message.
The project compiled nicely but I noticed one thing that don't work anymore and is the AutoHide function (that hide form automatically when mouse go over it).
After checking it, I notice that now the form.visible property seems to always return "false" whenever the form is actually visible.
Any idea of what could explain this ? may be one of 3.x updates changed the way form.visible works ?
-
Little precision, I use this to hide the form :
SetWindowPos(Handle,0,0,0,0,0,SWP_HIDEWINDOW+SWP_NOMOVE+SWP_NOSIZE+SWP_NOACTIVATE);
-
You didn't give a code which makes form visible. Do you use auto-hide bars locating on the side of the desktop? Be shorter, how to model your situation with a small portion of code. If I can reproduce the behavior, I may be could fix it or make an advice.
-
Hi,
Today I recompiled an other project but this one use standard form.show / form.hide. But testing form.visible always return false too.
regards.
-
I think I found the problem, I can reproduce it, it took me a while to figure it out as Form.Visible worked fine on a new fresh application.
Form.Visible work fine ... until you set Form.stayOnTop property (true or false break it same way, whenever form is already OnTop or not).
-
If I use Win32 API isWindowVisible(form.handle) the result is ok so I think that the problem is located somewhere inside KOL's form structure, the way a property touched by form.stayOnTop property writing and/or form.Visible reading.
-
This code
Form.StayOnTop := TRUE;
Form.Hide;
ShowMessage( 'FormVisible = ' + Int2Str(Integer(Form.Visible)) );
Form.Show;
shows 0.
This code
Form.StayOnTop := TRUE;
ShowMessage( 'FormVisible = ' + Int2Str(Integer(Form.Visible)) );
Form.Show;
shows 1.
Can you give a small portion of code which reproduces incorrect behavior?
-
I forgot to say that the form.stayOnTop is set inside FormOnShow event and that worked fine up to KOL 2.83 (I jumped directly to 3.15).
-
procedure TForm1.Button1Click(Sender: PObj);
begin
if Form.visible=true then showmessage('visible'); <-- never showed
end;
procedure TForm1.KOLFormShow(Sender: PObj);
begin
Form.StayOnTop:=true;
end;
-
procedure TForm1.Button1Click(Sender: PObj);
begin
if Form.visible=true then showmessage('form.visible see it'); <-- never showed
if isWindowVisible(form.handle)=true then showmessage('isWindowVisible see it'); <-- showed
end;
procedure TForm1.KOLFormShow(Sender: PObj);
begin
Form.StayOnTop:=true;
end;