Tick Posted April 16, 2021 Share Posted April 16, 2021 (edited) The main program window can have several child (MDIClient) windows for different purposes. The content of the main menu items depends on which of the windows is active. How to choose one of the child windows correctly? Opt("WinSearchChildren", 1) Opt("WinTitleMatchMode", 2) $hWnd=WinGetHandle ("GW:"); The part of the window name that I want to select WinActivate($hWnd) ; does not work, other child window still active MsgBox(0,"",WinGetTitle($hWnd)); the full name of the desired window is displayed This is not working in my case, desired window is not selected. WinActivate($hWnd, "GW:") not working too.. Autoit window info shows CLASS:MDIClient; INSTANCE:2; ID:65283, and Instance and ID value is not constant. When I close several windows and reopen the desired window, they may become different values. Only the title of the window is always the same. I found a way, but think it is not quite correct: $hWnd=WinGetHandle ("GW:") WinSetState($hWnd, "", @SW_MINIMIZE) WinSetState($hWnd, "", @SW_SHOWDEFAULT) the window is simply minimized and then restored, becoming active as I want. But it is not user friendly. I am sure there is a better solution. Please help me find it! Edited April 16, 2021 by Tick Link to comment Share on other sites More sharing options...
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
Already have an account? Sign in here.Sign In Now