odexed Posted May 5, 2012 Posted May 5, 2012 (edited) I faced with a problem - how to set focus to child window of MDI application. Main window activates well, but how to get child?WinActivate("[CLASS:PremierePro]","") ;sets focus to main windowWinActivate("[CLASS:HandlerAudioMixer::MixerView]","","") ;doesn't work P.S. Here is window info report:>>>> Window <<<<Title: Adobe Premiere Pro - E:My DocumentsAdobePremiere Pro1.51____n.prproj *Class: PremiereProPosition: 0, 0Size: 1440, 848Style: 0x16CF0000ExStyle: 0x00040100Handle: 0x000D064E>>>> Control <<<<Class: class HandlerAudioMixer::MixerViewInstance: 1ClassnameNN: class HandlerAudioMixer::MixerView1Name: Advanced (Class): [CLASS:class HandlerAudioMixer::MixerView; INSTANCE:1]ID: 1Text: Position: 810, 407Size: 202, 397ControlClick Coords: 12, 68Style: 0x56000000ExStyle: 0x00000000Handle: 0x0001094E>>>> Mouse <<<<Position: 826, 517Cursor ID: 0Color: 0xD4D0C8>>>> StatusBar <<<<1: >>>> ToolsBar <<<<>>>> Visible Text <<<<ProjectTabDockProjectWindowPlayerControlList BlinderVideoInPointCScrollBarScroll BarCScrollBarAudio MixerTabDockPositionDurationScrolling viewTrackReadMasterKnobHot float controlVUMeterVUMeterFaderHot fader controlTrackReadMasterKnobHot float controlVUMeterVUMeterFaderHot fader controlScroll BarCScrollBarTransportMaster ViewReadVUMeterVUMeterFaderHot fader controlMonitorTabDockTimeBarJogPositionDurationShuttleTimelineTabDockEditTimeControlTimeBarCScrollBarCScrollBarCScrollBar>>>> Hidden Text <<<<Contains:CScrollBarScroll BarCScrollBarWellParameter ControlKnobComboButtonPopupWellParameter ControlKnobComboButtonPopupWellParameter ControlKnobComboButtonPopup0,0TimeBarPositionZoomCScrollBarList HeaderList ViewKeyframe ViewTabDockCScrollBarTimeBarJogPositionDurationShuttleIn PointOut PointIntensityCheckboxCScrollBarIn PointOut PointIntensityCheckboxEffect ControlsTabDockEffectsTabDockStatusBarProgressBar Edited May 5, 2012 by odexed
stormbreaker Posted May 5, 2012 Posted May 5, 2012 Perhaps, using WinActivate("Adobe Premiere Pro", "") could also work. ---------------------------------------- :bye: Hey there, was I helpful? ---------------------------------------- My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1
odexed Posted May 5, 2012 Author Posted May 5, 2012 You are right, it works, but i need focus subwindow "Audio Mixer"
stormbreaker Posted May 5, 2012 Posted May 5, 2012 Try this: #include <WinAPI.au3> ChildActivate("Main Window Title", "Child Window Title") Func ChildActivate($appTitle, $formName) $hWnd = WinGetHandle($appTitle, $formName) $array = WinList($appTitle) WinActive($hWnd) $winarray = _WinAPI_EnumWindows(True, $hWnd) For $i = 1 to $winarray[0][0] $title = _WinAPI_GetWindowText($winarray[$i][0]) If ($title == $formName) or ($title == $formName & " *") Then _WinAPI_ShowWindow($winarray[$i][0], @SW_MAXIMIZE) _WinAPI_ShowWindow($winarray[$i][0], @SW_SHOWNORMAL) EndIf Next EndFunc Purely, title-specific odexed 1 ---------------------------------------- :bye: Hey there, was I helpful? ---------------------------------------- My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now