Jump to content

How to set focus in MDI program


Recommended Posts

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
Link to comment
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

Link to comment
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

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

:bye: Hey there, was I helpful?

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

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...