Recent

Author Topic: "WindowState:=wsMinimized; " bizarre  (Read 14132 times)

anna

  • Sr. Member
  • ****
  • Posts: 426
"WindowState:=wsMinimized; " bizarre
« on: July 12, 2010, 04:14:56 pm »
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: [Select]
procedure TForm1.Button1Click(Sender: TObject);
begin
  WindowState:=wsMinimized;
end;    
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.
WinXP SP3 Pro Russian 32-bit (5.1.2600)

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: "WindowState:=wsMinimized; " bizarre
« Reply #1 on: July 12, 2010, 04:21:15 pm »
Try this:

Code: [Select]
Application.Minimize;

anna

  • Sr. Member
  • ****
  • Posts: 426
Re: "WindowState:=wsMinimized; " bizarre
« Reply #2 on: July 12, 2010, 04:28:53 pm »
Try this:

Code: [Select]
Application.Minimize;

I have tried Application.Minimize; ,but in 10 cases out of hundred it fail.
Is there another way?
« Last Edit: July 12, 2010, 04:31:06 pm by anna »
WinXP SP3 Pro Russian 32-bit (5.1.2600)

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: "WindowState:=wsMinimized; " bizarre
« Reply #3 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.
« Last Edit: July 12, 2010, 04:49:47 pm by typo »

anna

  • Sr. Member
  • ****
  • Posts: 426
Re: "WindowState:=wsMinimized; " bizarre
« Reply #4 on: July 12, 2010, 05:11:38 pm »
What does it mean "it fails"?

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

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?
« Last Edit: July 12, 2010, 05:16:19 pm by anna »
WinXP SP3 Pro Russian 32-bit (5.1.2600)

anna

  • Sr. Member
  • ****
  • Posts: 426
Re: "WindowState:=wsMinimized; " bizarre
« Reply #5 on: July 12, 2010, 05:18:03 pm »
Where are developers? Why WindowState:=wsMinimized; doesn't work correct? Is it bug?
« Last Edit: July 12, 2010, 05:29:27 pm by anna »
WinXP SP3 Pro Russian 32-bit (5.1.2600)

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: "WindowState:=wsMinimized; " bizarre
« Reply #6 on: July 12, 2010, 06:16:30 pm »
Where are developers? Why WindowState:=wsMinimized; doesn't work correct? Is it bug?
It's not a bug. Lazarus acts in Delphi compatible way.

please use Application.Minimize. If it's failing, please provide reproducible bug report.

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: "WindowState:=wsMinimized; " bizarre
« Reply #7 on: July 12, 2010, 06:31:50 pm »
Try to use Application.ProcessMessages after minimizing.

 

TinyPortal © 2005-2018