Board index » delphi » wsMinimized doesn't dock Delphi 2 app on Win95 taskbar

wsMinimized doesn't dock Delphi 2 app on Win95 taskbar

Quote
> Something is does not look quite right when the Delphi 2 application is
> run/created with the WindowState := wsMinimized property for it's main
> form.  Here is the result visually (see GIF)...

> The minimized Delphi 2 application doesn't dock itself on the Win95
> taskbar...well, sort of...It does and it doesn't.  Not only is my Delphi
> application ("Another Notepad") window iconized on the Win95 taskbar, but
> there is also a second "icon?" (form caption?) that is resting on top of
> the Win95 taskbar.

Philip,

when you minimize a Delphi app the main form gets hidden, not minimized.
What is minimized is the Application.Window. But setting the form state to
wsMinimized actually minimized the form, which screws things up. Instead of
setting the form style do a

 PostMessage( Handle, WM_SYSCOMMAND, SC_CLOSE, 0 );

in the formcreate method.  

Peter Below (TeamB)  100113.1...@compuserve.com)

 

Re:wsMinimized doesn't dock Delphi 2 app on Win95 taskbar


Quote
> when you minimize a Delphi app the main form gets hidden, not minimized.
> What is minimized is the Application.Window. But setting the form state
to
> wsMinimized actually minimized the form, which screws things up. Instead
of
> setting the form style do a

>  PostMessage( Handle, WM_SYSCOMMAND, SC_CLOSE, 0 );

> in the formcreate method.  

Peter,

Thanks, but I this doesn't minimize the Delphi 2 application.  Instead, it
closes the application!  Am I doing something wrong?  Here's my code:

procedure TForm1.FormCreate(Sender: TObject);
...
StartupInfo.cb := SizeOf(StartupInfo);
GetStartupInfo (StartupInfo);
if StartupInfo.dwFlags and STARTF_USESHOWWINDOW <> 0 then begin
        case StartupInfo.wShowWindow of
                SW_SHOWMINIMIZED, SW_SHOWMINNOACTIVE: begin
                PostMessage( Handle, WM_SYSCOMMAND, SC_CLOSE);                          
                end;
                SW_SHOWMAXIMIZED: begin
                        WindowState := wsMaximized;
                end;
        end;
end;

Philip

Re:wsMinimized doesn't dock Delphi 2 app on Win95 taskbar


Philip,

gosh, did i really say SC_CLOSE? I need more sleep, definitely. That should
have been SC_MINIMIZE. Sorry to waste your time.

Peter Below (TeamB)  100113.1...@compuserve.com)

Re:wsMinimized doesn't dock Delphi 2 app on Win95 taskbar


Quote
> gosh, did i really say SC_CLOSE? I need more sleep, definitely.

Peter,

I guess if you didn't spend so much time helping out people like me then
you probably could get more sleep.  That's my way of saying "thanks"!

Now go back to sleep...  :-)

Philip Kapusta

Other Threads