If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

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.

All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

Re: Wondering how can we know the content of a dialogbox

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.

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.