AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Create Sys Tray / Capture

Ein Thema von Razor · begonnen am 1. Jul 2009 · letzter Beitrag vom 4. Jul 2009
 
Razor
(Gast)

n/a Beiträge
 
#4

Re: Create Sys Tray / Capture

  Alt 2. Jul 2009, 15:47
Ok i finally managed to do something..I can get Number of tray icons + tooltips however no icons or no mouse interactivity yet.So i hope you guys can help on that one.Ive done my part now i expect from you to do the same.

This works on WINDOWS 7264 RTM Build!

Delphi-Quellcode:
unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,shellAPI, ComCtrls, ImgList,commctrl, ExtCtrls;

type
  TForm2 = class(TForm)
    ListBox1: TListBox;
    Button1: TButton;
    Image1: TImage;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;
    h_Tray:hwnd;

function GetSysTrayWnd: HWND;
begin
  Result := FindWindow('Shell_TrayWnd', nil);
  Result := FindWindowEx(Result, 0, 'TrayNotifyWnd', nil);
  Result := FindWindowEx(Result, 0, 'SysPager', nil);
  Result := FindWindowEx(Result, 0, 'ToolbarWindow32', nil);
end;

procedure TForm2.Button1Click(Sender: TObject);
var
  h_ico: HICON;
  h_icolist: TStringlist;
  btn_count, i,handleicon: integer;
  h_Process, dwProcessID:DWord;
  Point: Pointer;
  btn_ico: TTBButton;
  nNumberOfBytesRead: dword;
  buffer: array[0..255] of Char;
begin
  h_Tray:=GetSysTrayWnd;
  btn_count:=sendmessage(h_Tray,TB_BUTTONCOUNT,0,0);
  GetWindowThreadProcessId(h_Tray,@dwProcessID);
  h_Process:=OpenProcess(PROCESS_VM_OPERATION or PROCESS_VM_READ or PROCESS_VM_WRITE,
                        false,
                        dwProcessID);
  point:=VirtualAllocEx(h_Process, nil,
                        4096,
                        MEM_RESERVE or MEM_COMMIT,
                        PAGE_READWRITE);
  for i:=0 to btn_count - 1 do
  begin
    SendMessage(h_Tray, TB_GETBUTTON, i, LPARAM(Point));
    ReadProcessMemory(h_Process,
                      (Point),
                      @btn_ico,
                      sizeof(btn_ico),
                      nNumberOfBytesRead);
    SendMessage(h_Tray, TB_GETBUTTONTEXT , i, LPARAM(Point));
    ReadProcessMemory(h_Process,
                      (Point),
                      @buffer,
                      sizeof(buffer),
                      nNumberOfBytesRead);
    listbox1.Items.Add(buffer);

  end;

  SHOWmessage(inttostr(btn_count));
  handleicon:=SendMessage(h_Tray,TB_GETIMAGELIST,0,0);
  ImageList_GetIcon(handleicon,0,0); ///????
  image1.Canvas.Handle:=ImageList_GetIcon(handleicon,1,0); ///????
Angehängte Grafiken
Dateityp: png untitled_208.png (45,0 KB, 30x aufgerufen)
  Mit Zitat antworten Zitat
 


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 17:09 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz