Jump to content

PowerShell Get-ControlHandle on MDI child Window Tab Control

Recommended Posts

I used this years ago and was delighted to see a .NET/PowerShell release was available and have been highly successful using it.  What I ran into was that I am automating the regression test of a win32 forms application and have had no problems getting control handles until I started trying to get controls from a window that is the child of the MDI.  I can get the window handle just fine, but when I try and get the control handle on that window for the tab control I keep getting a zero.  Oddly I can get all the other control handles on the window and the AutoIt Window info tool has no problem getting the information from the control. No errors are thrown, so I'm guessing that the key that I passed was not found.  Also in other windows for the same application I am able to get the tab control handle.

For reference:

$hWnd = Get-AU3WinHandle -Title 'Window Title Name'

$hCtl = Get-ControlHandle -WinHandle $hWnd -Control '[NAME:theTabControlName]'

Has anyone else seen this behavior?

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

    No registered users viewing this page.

  • Create New...