--- In email@example.com
, Gabor Szabo <gabor@p...> wrote:
> On Fri, 21 May 2004, pkaluski wrote:
> > If I have window with three controls:
> > Name (CustomEditControl), ControlID= 0
> > LastName (CustomEditControl), ControlID= 0
> > Age (CustomEditControl), ControlID= 0
> > Now, when I call FindWindowLike with ControlID = 0, I will get a
> > of 3 window handles. How would I programatically figure out, which
> > handle is for Age, which is for name and so on?
> I am not sure I understood the issue but can't you access theses
> by their title ?
> Anyway I am not a Windows developer but do you know why are there
> controls with the same ID ? I don't know any valid reason for this
> (correct me if I am wrong) so I would consider this as a bug. If the
> Application you are using is in your control you should report this
> a bug and get the developers fix this.
> Of course it means you have to reach a point where the developers
> make the application easily testable which might not be easy.
Thanks for your response.
To answer your questions:
1. Can't you access this control by it's title.
No, I can't because this control has no title.
2. Do I know why this is the case and is this a bug.
Well, the controls I am talking about are all controls of the same
type. They are ole controls used in MFC project. When you have project
wizard generate the proper code for you, it will add the control with
control ID = 0.
So it seams that either control id is not obligatory for a control or
ole controls are handled differently.