Link to home
Start Free TrialLog in
Avatar of nikolaosk
nikolaoskFlag for Greece

asked on

how to retrieve the captions of all open windows that belong to certain class+delphi

hi there

i need a function in delphi where i can pass as a parameter the name of a class e.g

ExploreWClass and CabinetWClass, and get a result back as a string of all the window captions that belong to this class.

for example

if two folder windows are open in my desktop

1) C:\Documents and Settings\user\Desktop\delphi
2) C:\Documents and Settings\user\Desktop\websites

i want the fuction to return me the following:

result=C:\Documents and Settings\user\Desktop\delphiC:\Documents and Settings\user\Desktop\websites

if 5 windows of a certain class are open i need as a result the concatenation of all these window captions

i have some code below. hope it helps

thanks

function Get_foldercaption(const thestring: WideString): WideString;
var
  foldercaption:cardinal;
  foldercaptiontext,foldercaptiontext1:array[0..255] of char;

begin
     
     //ExploreWClass and CabinetWClass should not be hardcoded like here but passed as parameters in the function
      foldercaption := FindWindow('ExploreWClass', nil);
      //foldercaption1 := FindWindow('CabinetWClass', nil);
      GetWindowText (foldercaption, foldercaptiontext, 256);
      Result := foldercaptiontext
     
End;
ASKER CERTIFIED SOLUTION
Avatar of Russell Libby
Russell Libby
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial