Results 1 to 5 of 5

Thread: [RESOLVED] What does hwnd2 means?

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2016
    Posts
    61

    Resolved [RESOLVED] What does hwnd2 means?

    I'm quite confused on my project I use Spy++. What do you call the child window having another child window? If I'm using FindWindowEx does it mean I need to create another one?! I know that hwnd1 is for parent window handler, but I can not figure out what is hwnd2... Can I assign 2 parents on FindWindowEx or do I define the 1st child window as another FindWindowEx and not FindWindow?! The textbox I'm looking at, is inside a frame window and Spy++ can not determine the class of that frame window... And that frame is inside the 1st child window... So I assume that the textbox belong to the 1st child window...

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: What does hwnd2 means?

    I don't use VB6 but Windows API calls work the same regardless language so I can answer this OK.

    You call FindWindow to get the handle of a top-level window. You call FindWindEx to get the handle of a direct child. If you want something that is a child of a child of a top-level window then you need to call FindWindoEx twice. The first time you use the handle of the top-level window as the parent to get its direct child, then you use the handle of that direct child as the parent to get the handle of its direct child. You would need to call FindWindowEx again for each further level you needed to go down to get to your target window.

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: What does hwnd2 means?

    It occurs to me that you might actually be referring to the 'hwndChildAfter' parameter of the FindWindowEx function. In that case, this actually means that you're trying to find the first sibling window after the one you specify. Lets say that a window has five edit controls in it and you want to get the third one. There's no way to get that directly just from the parent because FindWindowEx will just get the first match. You would call FindWindowEx once to get the handle of the first edit control, then you would call FindWindowEx again and use that handle as the 'hwndChildAfter' value to get the first match after that, i.e. the second edit control. You then call FindWindowEx a third time and use the handle of the second sibling as the value of 'hwndChildAfter' to get the third edit control.

  4. #4

    Thread Starter
    Member
    Join Date
    Apr 2016
    Posts
    61

    Re: What does hwnd2 means?

    Thank you for your answers...

  5. #5
    Member Dragokas's Avatar
    Join Date
    Aug 2015
    Location
    Ukraine
    Posts
    740

    Re: [RESOLVED] What does hwnd2 means?

    Maybe this program will be easier for you: Windowzer.
    Malware analyst, VirusNet developer, HiJackThis+ author || my CodeBank works

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width