Mutley2003
asked on
Always on Top - even after Minimize all
Hello there
How do I make a Delphi app that will stay on top even when all apps are minimized (with the Windows+M key).
I know it is possible because dragstrip (http://www.poppybank.com/DragStrip/windows/index.htm) does it .. it keeps a little bar docked to one side of the desktop, at all times
thanks
How do I make a Delphi app that will stay on top even when all apps are minimized (with the Windows+M key).
I know it is possible because dragstrip (http://www.poppybank.com/DragStrip/windows/index.htm) does it .. it keeps a little bar docked to one side of the desktop, at all times
thanks
download the full code of the above example from :
page: http://www.geocities.com/esoftbg/
link: Q_21131390.zip
page: http://www.geocities.com/esoftbg/
link: Q_21131390.zip
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
hello Mutley2003, there seems to be a solution for this at the EE question - -
https://www.experts-exchange.com/questions/20340906/Catching-Windows-M.html
https://www.experts-exchange.com/questions/20340906/Catching-Windows-M.html
Ivanov_G's answer works ;-)
ASKER
yes, it does, and I don't know why I did not close this off before.
My apologies, people.
My apologies, people.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm2 = class(TForm)
Memo: TMemo;
Timer: TTimer;
procedure FormShow(Sender: TObject);
procedure TimerTimer(Sender: TObject);
private { Private declarations }
procedure CreateParams(var Params: TCreateParams); override;
public { Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.FormShow(Sender: TObject);
var
B: Boolean;
L: Integer;
T: Integer;
R: TRect;
begin
B := False;
SystemParametersInfo(SPI_G
T := R.Bottom - Height;
L := R.Right - Width;
if (T<>Top) then
begin
B := True;
Top := T;
end;
if (L<>Left) then
begin
B := True;
Left := L;
end;
if B then
begin
Memo.Clear;
Memo.Lines.Add('Work area is the portion of the screen not obscured by the taskbar');
Memo.Lines.Add('Left=' + IntToStr(R.Left));
Memo.Lines.Add('Top=' + IntToStr(R.Top));
Memo.Lines.Add('Right=' + IntToStr(R.Right));
Memo.Lines.Add('Bottom=' + IntToStr(R.Bottom));
end;
end;
procedure TForm2.TimerTimer(Sender: TObject);
begin
FormShow(Self);
end;
procedure TForm2.CreateParams(var Params: TCreateParams);
begin
inherited;
with Params do
begin
ExStyle := ExStyle or WS_EX_TOPMOST;
WndParent := GetDesktopwindow;
Style := Style AND NOT WS_CAPTION;
end;
end;
end.