List Info

Thread: Re: How can I make a form globally "topmost" without having a taskbar button




Re: How can I make a form globally "topmost" without having a taskbar button
country flaguser name
United States
2007-09-24 16:37:15

Hello my friends and thank you for your quick suggestions.
My appologize for responding slowly. -I have been unavailable for
some while.

Vladimir - Your suggestions definitely makes the window topmost if I
also set the desktop as the window owner (instead of the application).
However, when I hide the extra button the button that is left still
does not work properly. The maximize and minimize choices doesn't
work.
Does anyone know how to correct this?

BR,
Lars

--- In delphi-en%40yahoogroups.com">delphi-enyahoogroups.com, "Vladimir Yushko&quot; <yahoo...>
wrote:
>
&gt; Hi!
> First hide the button created by Delphi for the Application:
>
> ShowWindow(Application.Handle, SW_HIDE);
> SetWindowLong(Application.Handle, GWL_EXSTYLE,
> GetWindowLong(Application.Handle, GWL_EXSTYLE) or
> WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);
> ShowWindow(Application.Handle, SW_SHOW);
>
> --
> Vladimir Yushko
&gt; http://yarrowsoft.com/
>
> ---
>

__._,_.___
.

__,_._,___
Re: Re: How can I make a form globally "topmost" without having a taskbar button
user name
2007-09-25 00:01:37

Hi,
You should override following methods:

procedure WMSysCommand(var Message: TWMSysCommand); message
WM_SYSCOMMAND;

procedure TTaskForm.WMSysCommand(var Message: TWMSysCommand);
begin
case (Message.cmdtype and $FFF0) of
SC_MINIMIZE:
begin
ShowWindow(handle, SW_MINIMIZE);
Message.result := 0;
end;
SC_RESTORE:
begin
ShowWindow(handle, SW_RESTORE);
Message.result := 0;
end;
else
inherited;
end;
end;

procedure TTaskForm.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
//Show a button for the main form
with Params do begin
ExStyle := ExStyle or WS_EX_APPWINDOW and not WS_EX_TOOLWINDOW;
WndParent := 0;
end;
end;

procedure TTaskForm.DoClose(var Action: TCloseAction);
begin
inherited;
Action := caFree;
end;

--
Vladimir Yushko
http://yarrowsoft.com/ solutions for Outlook Express

----- Original Message -----
From: "lars_stahre&quot; < lst%40lse.se">lstlse.se>;
To: < delphi-en%40yahoogroups.com">delphi-enyahoogroups.com>
Sent: Tuesday, September 25, 2007 1:37 AM
Subject: [delphi-en] Re: How can I make a form globally "topmost" without
having a taskbar button

> Hello my friends and thank you for your quick suggestions.
> My appologize for responding slowly. -I have been unavailable for
> some while.
&gt;
> Vladimir - Your suggestions definitely makes the window topmost if I
> also set the desktop as the window owner (instead of the application).
> However, when I hide the extra button the button that is left still
&gt; does not work properly. The maximize and minimize choices doesn't
> work.
&gt; Does anyone know how to correct this?
&gt;
> BR,
> Lars
>;
>
>
> --- In delphi-en%40yahoogroups.com">delphi-enyahoogroups.com, "Vladimir Yushko&quot; <yahoo...>
> wrote:
&gt; >
>; > Hi!
> > First hide the button created by Delphi for the Application:
> >
>; > ShowWindow(Application.Handle, SW_HIDE);
> > SetWindowLong(Application.Handle, GWL_EXSTYLE,
> > GetWindowLong(Application.Handle, GWL_EXSTYLE) or
> > WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);
> > ShowWindow(Application.Handle, SW_SHOW);
> >
>; > --
> > Vladimir Yushko
&gt; > http://yarrowsoft.com/
> >
>; > ---
> >
>;
>
>
>
> -----------------------------------------------------
> Home page: http://groups.yahoo.com/group/delphi-en/
> To unsubscribe: delphi-en-unsubscribe%40yahoogroups.com">delphi-en-unsubscribeyahoogroups.com
&gt; Yahoo! Groups Links
&gt;
>
>
>;
>

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )