Wondering how can we know the content of a dialogbox
Dear Gurus,
I was wondering how can we know how many items exist in a dialogbox?
If there any way that i can get the items ID in a dialogbox by having just the dialogbox's object or handler?
Or any way that we can get a dialogbox content by coding.
Thanks.
Re: Wondering how can we know the content of a dialogbox
EnumChildWindows might help you in case the dialog box is a true dialog box, i.e. a window of class "#32770". Otherwise there's no any guarantee you even be provided with a way for enumerating items.
Re: Wondering how can we know the content of a dialogbox
Dear Igor Vartanov,
I think the EnumChildWindows is not suit for this case.
What i try to do is to get the content of a dialogbox.
For example:
i have a dialogbox which have 3 button and 1 edit box.
If i have the window handle. Is there a way i can know the dialogbox have 3 button and 1 edit box?
Just like resource editor have all the information about a dialogbox.
Thanks.
Re: Wondering how can we know the content of a dialogbox
If you have the window handle for the dialog box, EnumChildWindows() will give you the window handle for each of the controls (windows) contained within the dialog. Using the control window handle, GetClassName() will give you the class name from which you can determine the type of the control (eg button, edit box etc). GetWindowInfo() can also be used to obtain other info about a control knowing its handle.
Re: Wondering how can we know the content of a dialogbox
Quote:
Originally Posted by
VbEndUser
I think the EnumChildWindows is not suit for this case.
And I think it does. Otherwise I would not recommend it.
Quote:
What i try to do is to get the content of a dialogbox.
For example:
i have a dialogbox which have 3 button and 1 edit box.
If i have the window handle. Is there a way i can know the dialogbox have 3 button and 1 edit box?
The way is to enumerate children controls and find out their window class names. You seem need to learn the subject more detailed.
Quote:
Just like resource editor have all the information about a dialogbox.
Beware of ungrounded conclusions based just on seeming similarities. Resource editor knows nothing about runtime windows. Instead it works with resource script where each and every dialog template and control is described in unambiguous statements. Besides, dialog template may be used for initial dialog creation having a few controls created later on the fly from scratch, and some ones destroyed and some hidden.
And my favorite case is when dialog emulates standard controls on its own by rendering control frames and visual traits while there's no control window exists at all. You may be absolutely sure you are working with buttons and editboxes while you are not. :)
Re: Wondering how can we know the content of a dialogbox
Dear Igor Vartanov and 2Kaud,
Thanks for correcting my mistake.
I didnot used the EnumChildWindows before and didnot go through in details about it.
I will learn the subject in more details.
Thanks for the advice for my problem.
Thank you very much.
Appreciate both your help.
Thanks.
Re: Wondering how can we know the content of a dialogbox
Please don't miss the link I provided in my previous message.