Jump to content

Recommended Posts

Posted

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?

Posted

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?

Posted

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.

  • Moderators
Posted

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).

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.

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
  • Moderators
Posted

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.

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.

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
Posted

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.

Posted

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.

Posted

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...

Posted

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.

 

Posted

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.

Posted

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

Posted

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.

 

Posted

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.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...