Sign in to follow this  
Followers 0
cdr

get list of child windows

18 posts in this topic

For my current creation, I'd like to be able to get a list of the child windows of an open window - a normal program, not autoit gui. Help?

I know you can get the parent window of a child using user32.dll, maybe something in there works?

Share this post


Link to post
Share on other sites



WinGetClassList

Gee, how helpful.

That gets, well, a list of classes.

Does that guarentee it'll get all of the child windows? How do I tell what's a window from that?

Share this post


Link to post
Share on other sites

Have no clue wtf you're talking about. I don't care how WinGetClassList is implemented, it doesn't even seem useful to me.

I just did a search for "WinGetClassList", got two pages of results about controls and none about finding child windows.

Mind actually pointing to something useful? Thanks.

Share this post


Link to post
Share on other sites

Have no clue wtf you're talking about. I don't care how WinGetClassList is implemented, it doesn't even seem useful to me.

I just did a search for "WinGetClassList", got two pages of results about controls and none about finding child windows.

Mind actually pointing to something useful? Thanks.

Yeah... you'll get far talking to people like that, especially a respected Mod like Larry (or any of them for that matter).

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I guess he must be respected for his... brevity?

Honestly, I can't see how he intended to help at all. His first post was one word, and his second one explained what it did rather than how it might be used to solve the problem.

I can sort of see how it could maybe be used, but that assumes the child window appears in the class list and that somehow you're able to tell which items in the list are windows.

He answered neither of those questions.

Edited by cdr

Share this post


Link to post
Share on other sites

I guess he must be respected for his... brevity?

Honestly, I can't see how he intended to help at all. His first post was one word, and his second one explained what it did rather than how it might be used to solve the problem.

I can sort of see how it could maybe be used, but that assumes the child window appears in the class list and that somehow you're able to tell which items in the list are windows.

He answered neither of those questions.

Actually... He probably did give you the answer in a round about way.... I haven't checked yet, but maybe do a search for EnumChildWindows ... It uses the user32.dll library also... and may just need a WindowHandle of the parent.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Dullard? Heh.

No, I don't know what a child window is, other than it's something contained in a parent window. Y'know, like AutoIt says it is with the "parent" option in GUICreate? Maybe you should educate me rather than calling me names.

I thought this was the AutoIt help forum, not the A-Hyper-Advanced-Windows-Programming-God-Like-Larry-Must-Be forum.

To make it really simple, I want a list of a windows that are contained in a specified window.

Sort of like child windows in a parent window, except I don't know what child windows are, so not.

For a very simple example, let's say I open up Notepad and open the Replace dialog.

On the other hand, thanks to SmOke_N for helping. I'll try to figure out EnumChildWindows.

Edited by cdr

Share this post


Link to post
Share on other sites

Again, this is a help forum, since you obviously haven't realized it yet.

If you don't want to help, no need to post.

Share this post


Link to post
Share on other sites

You should be nice before getting any help.

By child windows are you asking about controls such as buttons, editboxes, etc or MDI children?

Share this post


Link to post
Share on other sites

By child windows are you asking about controls such as buttons, editboxes, etc or MDI children?

By child windows I mean windows contained within the window. Not sure how you would consider a button or other control a window.

This could be a dialog, or whatever. I'm probably not concerned with MDI.

Like in the Notepad example, I'd like to be able to input notepad and have it return the Replace/Font/whatever dialog, if that's what was open.

Share this post


Link to post
Share on other sites

Because a button IS a child window...

Humor me. A button may be a child, but how is it a child window? I'm talking about the PARC-developed, Apple-stolen, Windows-popularized thing here. A button is something you might put in a window...

Share this post


Link to post
Share on other sites

hwndButton = CreateWindow( 
    "BUTTON",   // predefined class 
    "OK",      // button text 
    WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,  // styles 
 
    // Size and position values are given explicitly, because 
    // the CW_USEDEFAULT constant gives zero values for buttons. 
    10,      // starting x position 
    10,      // starting y position 
    100,        // button width 
    100,        // button height 
    hwnd,      // parent window 
    NULL,      // No menu 
    (HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE), 
    NULL);    // pointer not needed


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

That's not AutoIt code, so I'm not really sure what you're trying to do.

Anyway, the fact that there's a GuiCreate() function and a GuiCtrlCreate() function indicates that there's a difference.

You may be able to use a button as the source for a window, but it's still a window (in addition to being a button, maybe) and not a button inside a window.

Share this post


Link to post
Share on other sites

that was c code, and guess what AutoIt is written in.

What was I trying to do, what you asked, humor you.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

You're saying that a button can be a window, not that a button is a window. Big difference.

Share this post


Link to post
Share on other sites

You're saying that a button can be a window, not that a button is a window. Big difference.

What do you think many controls are?

A toolbar? hmmm that could be a child window (case and point look at the Gui Toolbar in my signature)

A statusbar? hmmm that could be a window (this one is now include in the beta, yep it's a window)

hyperlink? look at the gui hyperlink in my signature (yep it's a window)

etc..

In many instances that's exactly what they are

as to

For my current creation, I'd like to be able to get a list of the child windows of an open window - a normal program, not autoit gui. Help?

Therefore big difference or not you asked about non autoit gui child windows, depending on the application and what language it was written will determine if the control is child window or not.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Regardless, there's a difference between a window and something that's not a window, so there must be some way to tell them apart.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0