C# EnumChildWindows()

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a question about EnumChildWindows(). Currently I'm using this API
function to iterate through all the controls in another application. In my
call back function I call SendMessage() and pass WM_GETTEXT to return the
text in each child control. Everything works perfectly.

My question pertains to the Z-Order and expectations. Currently I take all
the values I pull out of this 3rd party app and populate a string array. On
my machine everything returns in the same order from the EnumChildWindows
call consistantly in the same order. I believe that if the 3rd party .EXE
that I'm pulling from changes (re-compiled, code changes, etc...) I can
expect that the return order of things might/will change. Can I expect that
if the .EXE doesn't change that I will always get things back in the same
order on every system in all circumstances?

Basically can I rely on index location within my array as always containing
the information of a specific control?

Thanks,
John
 
John F said:
Can I expect that
if the .EXE doesn't change that I will always get things back in the same
order on every system in all circumstances?

Always and All are big words. What is true today may not be true in the
unknown future. Why depend on Windows? If you require a certain order then
perhaps you should take measures to ensure it.

-- Alan
 
John,

Honestly, I wouldn't rely on that. The documentation for
EnumChildWindows doesn't make any claims about order, so I would say no, you
can't do this.
 
Thanks Gents....
--
John F


Nicholas Paldino said:
John,

Honestly, I wouldn't rely on that. The documentation for
EnumChildWindows doesn't make any claims about order, so I would say no, you
can't do this.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

John F said:
I have a question about EnumChildWindows(). Currently I'm using this API
function to iterate through all the controls in another application. In
my
call back function I call SendMessage() and pass WM_GETTEXT to return the
text in each child control. Everything works perfectly.

My question pertains to the Z-Order and expectations. Currently I take
all
the values I pull out of this 3rd party app and populate a string array.
On
my machine everything returns in the same order from the EnumChildWindows
call consistantly in the same order. I believe that if the 3rd party .EXE
that I'm pulling from changes (re-compiled, code changes, etc...) I can
expect that the return order of things might/will change. Can I expect
that
if the .EXE doesn't change that I will always get things back in the same
order on every system in all circumstances?

Basically can I rely on index location within my array as always
containing
the information of a specific control?

Thanks,
John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top