nikolaosk
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\delp hi
2) C:\Documents and Settings\user\Desktop\webs ites
i want the fuction to return me the following:
result=C:\Documents and Settings\user\Desktop\delp hiC:\Docum ents and Settings\user\Desktop\webs ites
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,folderca ptiontext1 :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;
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\delp
2) C:\Documents and Settings\user\Desktop\webs
i want the fuction to return me the following:
result=C:\Documents and Settings\user\Desktop\delp
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,folderca
begin
//ExploreWClass and CabinetWClass should not be hardcoded like here but passed as parameters in the function
foldercaption := FindWindow('ExploreWClass'
//foldercaption1 := FindWindow('CabinetWClass'
GetWindowText (foldercaption, foldercaptiontext, 256);
Result := foldercaptiontext
End;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.