Jump to content

WinActive


Recommended Posts

The notepad window is not active when you check if it is, so nothing happens and the script ends.

Run("notepad")

WinWaitActive("Un")

If WinActive("Un") Then

MsgBox(0, "", "Window was active")

EndIf

Thanks for your quick reply Manadar. So if I have to deal with a window that may pop up or may not pop up, the best option would be to use the timeout option of WinWaitActive?

Or is there any other better option?

Thanks,

Raj

Link to comment
Share on other sites

Of course, otherwise your script will be paused until if ever a window with this title (begin or end with) may be focused.

Could somebody please tell me why this doesn't seem to work:

CODE
Func _disableDriverSigningWin2008()

If WinWaitActive("Windows Security","", 60) Then

ControlFocus("Windows Security", "", "DirectUIHWND1")

ControlClick("Windows Security", "", "DirectUIHWND1")

ControlFocus("Windows Security", "", "Button1")

ControlClick("Windows Security", "", "Button1")

EndIf

EndFunc

I am trying to install a software automatically when windows may pop up a security dialogue saying that this driver is not signed.

I am using windows 2008 64-bit version.

Thanks,

Raj

Link to comment
Share on other sites

Can post the AutoIt Window Info summary of the window and the control you're trying to target? Don't know about Win 2008 anything so I don't know if it's the problem.

Hi,

Please see the Info below:

>>>> Window <<<<

Title: Windows Security

Class: #32770

Position: 173, 153

Size: 447, 222

Style: 0x96C80284

ExStyle: 0x00010101

Handle: 0x00000000000600BA

>>>> Control <<<<

Class: DirectUIHWND

Instance: 1

ClassnameNN: DirectUIHWND1

Advanced (Class): [CLASS:DirectUIHWND; INSTANCE:1]

ID:

Text:

Position: 0, 0

Size: 441, 197

ControlClick Coords: 117, 128

Style: 0x56000000

ExStyle: 0x00000000

Handle: 0x000000000006001A

>>>> Mouse <<<<

Position: 293, 303

Cursor ID: 2

Color: 0xD4D0C8

>>>> StatusBar <<<<

***********************

>>>> Window <<<<

Title: Windows Security

Class: #32770

Position: 114, 161

Size: 447, 222

Style: 0x96C80284

ExStyle: 0x00010101

Handle: 0x00000000000600BA

>>>> Control <<<<

Class: Button

Instance: 1

ClassnameNN: Button1

Advanced (Class): [CLASS:Button; INSTANCE:1]

ID:

Text: &Install

Position: 269, 120

Size: 62, 22

ControlClick Coords: 35, 13

Style: 0x50002000

ExStyle: 0x00000000

Handle: 0x00000000000300CE

>>>> Mouse <<<<

Position: 421, 316

Cursor ID: 2

Thanks,

Raj

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...