Autor Beitrag
Boldar
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1555
Erhaltene Danke: 70

Win7 Enterprise 64bit, Win XP SP2
Turbo Delphi
BeitragVerfasst: So 04.10.09 20:12 
Hallo,
mit diesem Code verstecke ich den Taskbareintrag:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure verstecken (handle: THandle);
begin
  ShowWindow(Handle, SW_HIDE) ;
  SetWindowLong(Handle, GWL_EXSTYLE, getWindowLong(Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW) ;
  ShowWindow(Handle, SW_SHOW) ;
end;


Aber wie zeige ich den Wieder an?

Moderiert von user profile iconNarses: Code- durch Delphi-Tags ersetzt
dummzeuch
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 593
Erhaltene Danke: 5


Delphi 5 ent, Delphi 6 bis Delphi XE8 pro
BeitragVerfasst: So 04.10.09 20:15 
user profile iconBoldar hat folgendes geschrieben Zum zitierten Posting springen:

Aber wie zeige ich den Wieder an?


Ohne es getestet zu haben, wuerde ich es mal mitfolgendem versuchen:

ausblenden Delphi-Quelltext
1:
2:
3:
  ShowWindow(Handle, SW_HIDE) ;
  SetWindowLong(Handle, GWL_EXSTYLE, getWindowLong(Handle, GWL_EXSTYLE) and not WS_EX_TOOLWINDOW) ;
  ShowWindow(Handle, SW_SHOW) ;
Boldar Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1555
Erhaltene Danke: 70

Win7 Enterprise 64bit, Win XP SP2
Turbo Delphi
BeitragVerfasst: So 04.10.09 20:18 
hab ich schon probiert, aber funst nit.
Aber ich merke grade, dass auch der Code zum verstecken nich funst.
Es werden Lustige Herumschiebbare fensterschnipsel erstellt (so 3), die aussehen wie ne zerstückelte Titelleiste.
Wie kann ich den Code modifizieren, dass erfunktioniert?
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19341
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 04.10.09 20:21 
Schau mal in die Doku und nimm dann das was dort steht.
msdn.microsoft.com/e...ibrary/ms632680.aspx
WS_EX_APPWINDOW ;-)
galagher
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2562
Erhaltene Danke: 46

Windows 10 Home
Delphi 10.1 Starter, Lazarus 2.0.6
BeitragVerfasst: Fr 09.10.09 17:22 
user profile iconBoldar hat folgendes geschrieben Zum zitierten Posting springen:
hab ich schon probiert, aber funst nit.

Bei mir "funst" auch der Code zum Verstecken des Taskbar-Eintrags nicht. Irgendwie tut das gar nichts...

_________________
gedunstig war's - und fahle wornen zerschellten karsig im gestrock. oh graus, es gloomt der jabberwock - und die graisligen gulpen nurmen!
galagher
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2562
Erhaltene Danke: 46

Windows 10 Home
Delphi 10.1 Starter, Lazarus 2.0.6
BeitragVerfasst: Fr 09.10.09 17:27 
... muss ja auch heissen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
 with Application do // !
 begin
  ShowWindow(Handle, SW_HIDE) ;
  SetWindowLong(Handle, GWL_EXSTYLE, getWindowLong(Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW) ;
  ShowWindow(Handle, SW_SHOW) ;
 end;

_________________
gedunstig war's - und fahle wornen zerschellten karsig im gestrock. oh graus, es gloomt der jabberwock - und die graisligen gulpen nurmen!
galagher
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2562
Erhaltene Danke: 46

Windows 10 Home
Delphi 10.1 Starter, Lazarus 2.0.6
BeitragVerfasst: Fr 09.10.09 17:29 
... und wieder anzeigen geht so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
 with Application do
 begin
  ShowWindow(Handle, SW_HIDE) ;
  SetWindowLong(Handle, GWL_EXSTYLE, getWindowLong(Handle, GWL_EXSTYLE) xor WS_EX_TOOLWINDOW) ;
  ShowWindow(Handle, SW_SHOW) ;
 end;

Hab's einfach mal ausprobiert, es klappt!

_________________
gedunstig war's - und fahle wornen zerschellten karsig im gestrock. oh graus, es gloomt der jabberwock - und die graisligen gulpen nurmen!
galagher
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2562
Erhaltene Danke: 46

Windows 10 Home
Delphi 10.1 Starter, Lazarus 2.0.6
BeitragVerfasst: Fr 09.10.09 17:31 
... he - es klappt ja allein schon mit xor! Man braucht gar keinen Code mit or - xor ist es!

_________________
gedunstig war's - und fahle wornen zerschellten karsig im gestrock. oh graus, es gloomt der jabberwock - und die graisligen gulpen nurmen!
galagher
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2562
Erhaltene Danke: 46

Windows 10 Home
Delphi 10.1 Starter, Lazarus 2.0.6
BeitragVerfasst: Fr 09.10.09 17:59 
... sorry, ich schon wieder:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
//Verstecken:
 ShowWindow(GetWindow(Handle, GW_OWNER), SW_HIDE);
//Wie sollte es anders sein - zeigen:
 ShowWindow(GetWindow(Handle, GW_OWNER), SW_SHOW);

_________________
gedunstig war's - und fahle wornen zerschellten karsig im gestrock. oh graus, es gloomt der jabberwock - und die graisligen gulpen nurmen!
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19341
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 10.10.09 13:45 
Es gibt übrigens auch eine Editiermöglichkeit hier im Forum. :zwinker:

Jedenfalls hat WS_EX_TOOLWINDOW eine andere Bedeutung, auch wenn es auch mit dem Taskleisteneintrag zu tun hat.
Zitat:
Creates a tool window; that is, a window intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the taskbar or in the dialog that appears when the user presses ALT+TAB. If a tool window has a system menu, its icon is not displayed on the title bar. However, you can display the system menu by right-clicking or by typing ALT+SPACE.
Um was es hier geht ist wie gesagt WS_EX_APPWINDOW.
Zitat:
Forces a top-level window onto the taskbar when the window is visible.