Forum > General

"WindowState:=wsMinimized; " bizarre

(1/2) > >>

anna:
I use Lazarus-0.9.29-26562-fpc-2.4.0-20100710-win32.exe
My operating system is WinXP SP3.
So.
I put on form Button1 and wrote this into handler:

--- Code: ---procedure TForm1.Button1Click(Sender: TObject);
begin
  WindowState:=wsMinimized;
end;    
--- End code ---
Then compile.
When I press Button1, my application minimizes. But when I press  taskbar button of my minimized application, it maximize into stupid small window title, glued to the taskbar Start Button:
http://img821.imageshack.us/img821/3448/39663804.png

Well, how to minimize form correct? I mean mininmization must imitate human click on Minimize.

typo:
Try this:


--- Code: ---Application.Minimize;
--- End code ---

anna:

--- Quote from: typo on July 12, 2010, 04:21:15 pm ---Try this:


--- Code: ---Application.Minimize;
--- End code ---

--- End quote ---

I have tried Application.Minimize; ,but in 10 cases out of hundred it fail.
Is there another way?

typo:
What does it mean "it fails"?

I've tried over 10 times and has not failed any time.

anna:

--- Quote from: typo on July 12, 2010, 04:34:42 pm ---What does it mean "it fails"?

I've tried over 10 times and has not failed any time.

--- End quote ---

I have very many processes running at the same time. And sometimes Application.Minimize; don't have any effect. Mayby there's no enough memory. I don't know such nuance.
And sometimes Application.Minimize does not attract to OnWindowStateChange event.
Nevertheless, is there another way?

Navigation

[0] Message Index

[#] Next page

Go to full version