Конференция "KOL" » form.visible always return false [Delphi, Windows]
 
  • Dodfr (11.11.11 18:55) [0]
    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 ?
  • Dodfr (11.11.11 19:07) [1]
    Little precision, I use this to hide the form :

    SetWindowPos(Handle,0,0,0,0,0,SWP_HIDEWINDOW+SWP_NOMOVE+SWP_NOSIZE+SWP_NOACTIVATE);
  • Vladimir Kladov © (18.11.11 19:17) [2]
    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.
  • Dodfr (21.11.11 21:15) [3]
    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.
  • Dodfr (22.11.11 02:58) [4]
    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).
  • Dodfr (22.11.11 13:04) [5]
    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.
  • Vladimir Kladov © (22.11.11 17:46) [6]
    This code

       Form.StayOnTop := TRUE;
       Form.Hide;
       ShowMessage( 'FormVisible = ' + Int2Str(Integer(Form.Visible)) );
       Form.Show;


    shows 0.

    This code

       Form.StayOnTop := TRUE;
       //Form.Hide;
       ShowMessage( 'FormVisible = ' + Int2Str(Integer(Form.Visible)) );
       Form.Show;


    shows 1.

    Can you give a small portion of code which reproduces incorrect behavior?
  • Dodfr (22.11.11 20:19) [7]
    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).
  • Dodfr (22.11.11 20:21) [8]
    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;
  • Dodfr (22.11.11 20:25) [9]
    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;
 
Конференция "KOL" » form.visible always return false [Delphi, Windows]
Есть новые Нет новых   [119256   +38][b:0][p:0.001]