AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi Extract Tray And set its new Parent...
Thema durchsuchen
Ansicht
Themen-Optionen

Extract Tray And set its new Parent...

Ein Thema von Razor · begonnen am 5. Jul 2009 · letzter Beitrag vom 6. Jul 2009
Antwort Antwort
Razor
(Gast)

n/a Beiträge
 
#1

Extract Tray And set its new Parent...

  Alt 5. Jul 2009, 19:42
Hey!


Yes i found a new way to extract tray but i got a problem the background is kind of weird...(It updates fine and is full controlable);I figured this long ago but forgot..EnableBlurBehindWindow or Extendtoclient i used i dont konw but HELP!

Code:

Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
var
  wndMain, wndChild: HWND;
begin
  wndMain := FindWindow('Shell_TrayWnd','');
  if wndMain <> 0 then
  begin
    wndChild := FindWindowEx(wndMain, 0, 'TrayNotifyWnd', nil);
    wndChild := FindWindowEx(wndChild, 0, 'SysPager', nil);
    wndChild := FindWindowEx(wndChild, 0, 'ToolbarWindow32', nil);
    if wndChild <> 0 then
    begin
      ShowMessage('Window Handle: ' + IntToStr(wndChild));

      windows.SetParent(wndchild,form1.handle);
      EnableBlurBehindWindow(form1.Handle);

    end;
  end;
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
43.167 Beiträge
 
Delphi 12 Athens
 
#2

Re: Extract Tray And set its new Parent...

  Alt 5. Jul 2009, 20:22
Although I have no solution for this, but before someone tried it!
...


Ich hab hierfür zwar keine Lösung, aber bevor es jemand ausprobiert!

Dieser Code klaut das TrayWindow aus der Taskleiste und demnach ist in der Taskleiste diesbezüglich nichts mehr bediehnbar.
Und noch schlimmer, wird das Programm beendet und das TrayWindow nicht zurückgegeben, dann wird dieses mit geschloßen.
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#3

Re: Extract Tray And set its new Parent...

  Alt 5. Jul 2009, 20:23
The only problem i have is the weird background then its ready to transplantation on a new taskbar...
  Mit Zitat antworten Zitat
Benutzerbild von turboPASCAL
turboPASCAL

Registriert seit: 8. Mai 2005
Ort: Sondershausen
4.274 Beiträge
 
Delphi 6 Personal
 
#4

Re: Extract Tray And set its new Parent...

  Alt 5. Jul 2009, 20:33
Ich habe das Nicht ausprobiert, da ich nicht daraus schlau geworden bin...
Aber mal fragen was Razor möchte darf man doch ?
Matti
Meine Software-Projekte - Homepage - Grüße vom Rüsselmops -Mops Mopser
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#5

Re: Extract Tray And set its new Parent...

  Alt 5. Jul 2009, 20:50
Zitat von himitsu:
Although I have no solution for this, but before someone tried it!
...


Ich hab hierfür zwar keine Lösung, aber bevor es jemand ausprobiert!

Dieser Code klaut das TrayWindow aus der Taskleiste und demnach ist in der Taskleiste diesbezüglich nichts mehr bediehnbar.
Und noch schlimmer, wird das Programm beendet und das TrayWindow nicht zurückgegeben, dann wird dieses mit geschloßen.
No it WILL NOT be terminated becouse it will be a new taskbar..If you have a better idea how i should get system tray SPEAK UP!


Well yes i figured it out long time ago but i did use one of the functions to remove the background...
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
43.167 Beiträge
 
Delphi 12 Athens
 
#6

Re: Extract Tray And set its new Parent...

  Alt 5. Jul 2009, 21:18
Create a new toolbar, which you can then sign themselves and clone the data from the other toolbar.

The background is painted by TrayNotifyWnd.
Log the messages to this window and see whether what the right thing is what you will still have to implement.


Before anyone tried the code above, then prefer to take this one, which the Toolbar is also released.
Bevor jemand den oberen Code ausprobiert, dann nehmt lieber diesen hier, welcher die Toolbar auch wieder freigibt.
Delphi-Quellcode:
type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    { Private-Deklarationen }
    _window, _parent: HWND;
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
  wndMain, wndChild: HWND;
begin
  wndMain := FindWindow('Shell_TrayWnd','');
  if wndMain <> 0 then
  begin
    wndChild := FindWindowEx(wndMain, 0, 'TrayNotifyWnd', nil);
    wndChild := FindWindowEx(wndChild, 0, 'SysPager', nil);
    wndChild := FindWindowEx(wndChild, 0, 'ToolbarWindow32', nil);
    if wndChild <> 0 then
    begin
      ShowMessage('Window Handle: ' + IntToStr(wndChild));
      _window := wndchild;
      _parent := windows.GetParent(_window);
      windows.SetParent(wndchild, form1.handle);
      //EnableBlurBehindWindow(form1.Handle);

    end;
  end;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  windows.SetParent(_window, _parent);
end;
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#7

Re: Extract Tray And set its new Parent...

  Alt 6. Jul 2009, 11:02
Well the only problem is background...
Miniaturansicht angehängter Grafiken
untitled_197.jpg  
  Mit Zitat antworten Zitat
Antwort Antwort


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 11:11 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