AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language Delphi Problem with "stay on top" and application task button

Problem with "stay on top" and application task button

Ein Thema von WojTec · begonnen am 10. Jan 2012 · letzter Beitrag vom 13. Jan 2012
Antwort Antwort
WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#1

Problem with "stay on top" and application task button

  Alt 10. Jan 2012, 16:53
Delphi-Version: 2010
I have main window and modal window.
Modal window is set to be on top.
I create modal window, hide main and show modal one.
Modal window is not on top.

How:
- make modal window on top
- don't hide application button on task bar when hide main window
?
  Mit Zitat antworten Zitat
WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#2

Re: Problem with "stay on top" and application task button

  Alt 11. Jan 2012, 19:52
Anyone? Please
  Mit Zitat antworten Zitat
Benutzerbild von MGC
MGC

Registriert seit: 15. Mai 2008
Ort: Helsa
106 Beiträge
 
Turbo Delphi für Win32
 
#3

AW: Problem with "stay on top" and application task button

  Alt 11. Jan 2012, 20:58
Hello,

please don't Hide your MainForm, but set it's WindowState to wsMinimized. Then your TaskBar-Button should still be there and while your Modal-Form isn't closed, the user shouldn't be able to maximize the MainForm by clicking on the Taskbutton.

If your StayOnTop-Window is after minimizing not on the top then you can bring it to front again with Application.RestoreTopMosts.

Good luck.
Marc
Programmieren ist wie Chemie:
1. Wenn man alles einfach nur zusammenschmeisst kommt es zu unerwarteten Reaktionen.
2. Wenn es plötzlich anfängt zu qualmen, muss man eben noch mal von vorn anfangen.

Geändert von MGC (11. Jan 2012 um 21:07 Uhr)
  Mit Zitat antworten Zitat
WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#4

Re: Problem with "stay on top" and application task button

  Alt 12. Jan 2012, 09:49
Thanks I used special class to fix "on top" (TStayOnTopFixer) I found some time ago on the Net and RestoreTopMosts() in form OnCreate and finally modal form is on top . But it don't wanted be on top without these 2 tricks. Is this VCL bug or Windows bug or I still doing something wrong?

Geändert von WojTec (12. Jan 2012 um 09:51 Uhr)
  Mit Zitat antworten Zitat
Benutzerbild von MGC
MGC

Registriert seit: 15. Mai 2008
Ort: Helsa
106 Beiträge
 
Turbo Delphi für Win32
 
#5

AW: Problem with "stay on top" and application task button

  Alt 13. Jan 2012, 21:44
It's no bug, neither in Windows nor in Delphi. It's Delphi / VCL specific. If you create an application with Delphi-VCL you can't address your mainform directly. A message you send to the mainform will always be managed by the TApplication-Part.
You can test this behaviour if you create two seperate applications, hide the mainform in app 1 and your Task-Button disappears. Then send a SW_RESTORE or SW_SHOW message from app 2 to app 1 and you can see that your Task-Button will be shown again, but not your MainForm. To set it visible, you have to handle this message-event byself and show your mainform from inner your app 1 (Form1.show).
If you hide your mainform, it seems your application normalizes all the StayOnTops, too and your StayOnTop is not at the expected position (in front of all), so you have to restore it by calling Application.RestoreTopMosts.

I hope my english was well enough to explain the matters.

Greetings,
Marc
Programmieren ist wie Chemie:
1. Wenn man alles einfach nur zusammenschmeisst kommt es zu unerwarteten Reaktionen.
2. Wenn es plötzlich anfängt zu qualmen, muss man eben noch mal von vorn anfangen.

Geändert von MGC (13. Jan 2012 um 22:00 Uhr)
  Mit Zitat antworten Zitat
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:31 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz