Sign in to follow this  
Followers 0
odexed

How to set focus in MDI program

5 posts in this topic

#1 ·  Posted (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 window

WinActivate("[CLASS:HandlerAudioMixer::MixerView]","","") ;doesn't work

Posted Image

P.S. Here is window info report:

>>>> Window <<<<

Title: Adobe Premiere Pro - E:My DocumentsAdobePremiere Pro1.51____n.prproj *

Class: PremierePro

Position: 0, 0

Size: 1440, 848

Style: 0x16CF0000

ExStyle: 0x00040100

Handle: 0x000D064E

>>>> Control <<<<

Class: class HandlerAudioMixer::MixerView

Instance: 1

ClassnameNN: class HandlerAudioMixer::MixerView1

Name:

Advanced (Class): [CLASS:class HandlerAudioMixer::MixerView; INSTANCE:1]

ID: 1

Text:

Position: 810, 407

Size: 202, 397

ControlClick Coords: 12, 68

Style: 0x56000000

ExStyle: 0x00000000

Handle: 0x0001094E

>>>> Mouse <<<<

Position: 826, 517

Cursor ID: 0

Color: 0xD4D0C8

>>>> StatusBar <<<<

1:

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

Project

TabDock

ProjectWindowPlayerControl

List Blinder

VideoInPoint

CScrollBar

Scroll Bar

CScrollBar

Audio Mixer

TabDock

Position

Duration

Scrolling view

Track

Read

Master

Knob

Hot float control

VUMeter

VUMeter

Fader

Hot fader control

Track

Read

Master

Knob

Hot float control

VUMeter

VUMeter

Fader

Hot fader control

Scroll Bar

CScrollBar

Transport

Master View

Read

VUMeter

VUMeter

Fader

Hot fader control

Monitor

TabDock

TimeBar

Jog

Position

Duration

Shuttle

Timeline

TabDock

EditTimeControl

TimeBar

CScrollBar

CScrollBar

CScrollBar

>>>> Hidden Text <<<<

Contains:

CScrollBar

Scroll Bar

CScrollBar

Well

Parameter Control

Knob

ComboButtonPopup

Well

Parameter Control

Knob

ComboButtonPopup

Well

Parameter Control

Knob

ComboButtonPopup

0,0

TimeBar

Position

Zoom

CScrollBar

List Header

List View

Keyframe View

TabDock

CScrollBar

TimeBar

Jog

Position

Duration

Shuttle

In Point

Out Point

Intensity

Checkbox

CScrollBar

In Point

Out Point

Intensity

Checkbox

Effect Controls

TabDock

Effects

TabDock

StatusBarProgressBar

Edited by odexed

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

You are right, it works, but i need focus subwindow "Audio Mixer"

Share this post


Link to post
Share on other sites

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

1 person likes this

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Share this post


Link to post
Share on other sites

Thank you, it works fine

Share this post


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
Sign in to follow this  
Followers 0