[Lazarus] Should TTrayIcon work?

Tommi Prami tommi.prami at gmail.com
Thu Mar 21 08:42:12 CET 2013


On 20.3.2013 19:28, Tommi Prami wrote:
> On 19.3.2013 9:46, Tommi Prami wrote:
>> HEllo,
>>
>> I call TTrayIcon.Show at the Main Form OnCreate event.
>>
>> I shows OK, and as latest effort also the menu appears, but none of the
>> Click events comes to the my program.
>>
>> Click, Do8uble Click and also the Menu Click Event are not fired.
>>
>> What could cause this, or is the TTrayIcon still in middle of
>> development or so?
>>
>> Lazarus 1.0.6 / FPC 2.6.0 / Win32
>>
>> -Tee-
>>
>
> OK,
>
> This was not issue of the TTrayIcon at all,..
>
> First I forgot the Release Compiling option so Brake points did not work...
>
> And couple other issues that I did not see coming...
>
> If I had code like this
>
> Self.WindowsState := wsMinimized;
> Self.Visible := False;
>
> And then I had in TrayIcon event
>
> if not Self.Visible then
> begin
>    .. Show the form here
> end;
>
> The Seems that form thought it would be visible even I set it False just
> before...
>
> So I took the If out of there, so it works... (Did not check
> WindowsState, maybe that would work???)
>
> And then the final Gotcha...
>
> I added Start Minimized Functionality to Program and if I set minimize
> the Form and set visible to False on Forms.OnCreate Event. Form never
> comes back again.
>
> I made Hack to start timer with Short delay, and do the minimizing of
> the Form there. After the form has been shown, then it works...
>
> Not sure are these bugs, (In FPC/Lazarus level or even Windows) or how I
> could hide the Window without showing the Glimpse of it before...
>
> And if I set forms Visible to False, one could think you can trust it
> stays that way ;)
>
> I can file bug reports if thse seems to be bugs...
>
> -tee-

OK, this gets last in here... So I make new "thread"...

-tee-




More information about the Lazarus mailing list