jamesr123456
asked on
fsstayontop form disappears when i click show desktop in winxp
I have a form with the style set to fsstayontop. The form stays on top until I press "show desktop" on the winxp taskbar. How can i make my form stay on top all the time?
Thanks
Thanks
or similarly to what wildzero said:
in a timer:
form1.bringtofront;
or
application.bringtofront;
Alternatively have a look at this post for more information:
https://www.experts-exchange.com/questions/21148766/How-can-i-check-if-the-user-gave-a-LEFT-MOUSE-CLICK-out-the-application.html
You could use the left click out procedure i wrote in the post above to have form1.bringtofront instead of in a timer
in a timer:
form1.bringtofront;
or
application.bringtofront;
Alternatively have a look at this post for more information:
https://www.experts-exchange.com/questions/21148766/How-can-i-check-if-the-user-gave-a-LEFT-MOUSE-CLICK-out-the-application.html
You could use the left click out procedure i wrote in the post above to have form1.bringtofront instead of in a timer
With showdesktop Windows minimises all the apps. To keep your app up use:
application.Restore;
You could put this in a timer of 100 so that when you app is minimised by showdesktop then it will automatically restore.
To minimise normally just turn of the timer when you minimise
application.Restore;
You could put this in a timer of 100 so that when you app is minimised by showdesktop then it will automatically restore.
To minimise normally just turn of the timer when you minimise
This is perhaps a more elegant solution :
procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMinimize := AppStartTimer;
end;
procedure TForm1.AppStartTimer(Sende r: TObject);
begin
Timer1.Enabled := True;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Application.Restore;
Timer1.Enabled := False;
end;
Hypoviax
procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMinimize := AppStartTimer;
end;
procedure TForm1.AppStartTimer(Sende
begin
Timer1.Enabled := True;
end;
procedure TForm1.Timer1Timer(Sender:
begin
Application.Restore;
Timer1.Enabled := False;
end;
Hypoviax
ASKER
hmmm. I dont really want a honkey solution. I'd like it to stop it disappearing in the first place. The taskbar can stay visible, and I have "Statbar" running at the top of my screen which also stays visible.
Im increasing the points.
Im increasing the points.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Nice code Ivanov_G, it works well, i reccomend his post to be accepted,
Hypoviax
Hypoviax
type
TForm2 = class(TForm)
Memo: TMemo;
private { Private declarations }
procedure CreateParams(var Params: TCreateParams); override;
public { Public declarations }
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;
TForm2 = class(TForm)
Memo: TMemo;
private { Private declarations }
procedure CreateParams(var Params: TCreateParams); override;
public { Public declarations }
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;
please remove the line:
Style := Style AND NOT WS_CAPTION;
Style := Style AND NOT WS_CAPTION;
Hypo, thanks bro :))))
No worries, the best answer deserves the points
Hypoviax
Hypoviax
Not sure if that will work - but could be worth a shot ;)