Hi Phil. try this. I use this to get info from another application and use 
this code.

Jeremy

function 
GetStatusBarText: string;
var
  PMM: TProcessMemMgr;
  
NumberOfPanels, Len: Integer;
  PrcBuf: PChar;
  hWindow, 
hStatusBarHandle: HWND;
  PanelNumber : integer;
begin


  PanelNumber:=2;

  hWindow := FindWindow('TfmMain', 
nil);
  if hWindow = 0 then Exit;
  hStatusBarHandle := 
FindWindowEx(hWindow, 0, 'TStatusbar', nil);

  if 
hStatusBarHandle = 0 then Exit;
  PMM := 
CreateProcessMemMgrForWnd(hStatusBarHandle);
  try

    NumberOfPanels := SendMessage(hStatusBarHandle, 
SB_GETPARTS, 0, 0);
    if PanelNumber < NumberOfPanels 
then
    begin
      Len := 
LOWORD(SendMessage(hStatusBarHandle, SB_GETTEXTLENGTH, PanelNumber, 0));

      if Len > 0 then

      begin

        PrcBuf := PMM.AllocMem(Len + 
1);
        
SendMessage(hStatusBarHandle, SB_GETTEXT, PanelNumber, Longint(PrcBuf));

        Result := PMM.ReadStr(PrcBuf);

        PMM.FreeMem(PrcBuf);

      end
      else

      begin

        Result := '';

      end;
    end;
  
finally
    PMM.Free;
  end;
end;


-----Original Message-----

From: "Phil Scadden" <[EMAIL PROTECTED]>

To: delphi@delphi.org.nz

Date: Mon, 30 Jul 2007 14:57:32 +1200

Subject: [DUG] Pulling status bar text off another application




A webapp running in IE put text in the status bar that I would dearly 
like

to snaffle into another running application. Statusbar I think is a 
wincontrol

so could be possible. Anyone with bright ideas on discovering it?



----------------------------------------------------------

Phil Scadden, GNS Science Ltd

764 Cumberland St, Private Bag 1930, Dunedin, New Zealand

Ph +64 3 4799663, fax +64 3 477 5232



_______________________________________________

NZ Borland Developers Group - Delphi mailing list

Post: delphi@delphi.org.nz

Admin: http://delphi.org.nz/mailman/listinfo/delphi 
[http://delphi.org.nz/mailman/listinfo/delphi]

Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: 
unsubscribe
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe

Reply via email to