Entwickler-Ecke
Windows API - Code rückgängig machen
Boldar - So 04.10.09 20:12
Titel: Code rückgängig machen
Hallo,
mit diesem Code verstecke ich den Taskbareintrag:
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
Narses: Code- durch Delphi-Tags ersetzt
dummzeuch - So 04.10.09 20:15
Boldar hat folgendes geschrieben : |
Aber wie zeige ich den Wieder an? |
Ohne es getestet zu haben, wuerde ich es mal mitfolgendem versuchen:
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 - 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?
galagher - Fr 09.10.09 17:22
Boldar hat folgendes geschrieben : |
| hab ich schon probiert, aber funst nit. |
Bei mir "funst" auch der Code zum Verstecken des Taskbar-Eintrags nicht. Irgendwie tut das gar nichts...
galagher - Fr 09.10.09 17:27
... muss ja auch heissen:
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; |
galagher - Fr 09.10.09 17:29
... und wieder anzeigen geht so:
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!
galagher - Fr 09.10.09 17:31
... he - es klappt ja allein schon mit xor! Man braucht gar keinen Code mit or - xor ist es!
galagher - Fr 09.10.09 17:59
... sorry, ich schon wieder:
Delphi-Quelltext
1: 2: 3: 4:
| ShowWindow(GetWindow(Handle, GW_OWNER), SW_HIDE); ShowWindow(GetWindow(Handle, GW_OWNER), SW_SHOW); |
jaenicke - 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. |
Entwickler-Ecke.de based on phpBB
Copyright 2002 - 2011 by Tino Teuber, Copyright 2011 - 2026 by Christian Stelzmann Alle Rechte vorbehalten.
Alle Beiträge stammen von dritten Personen und dürfen geltendes Recht nicht verletzen.
Entwickler-Ecke und die zugehörigen Webseiten distanzieren sich ausdrücklich von Fremdinhalten jeglicher Art!