Sign in to follow this  
Followers 0
GZE

WinActivate

5 posts in this topic

#1 ·  Posted (edited)

Hello,

I would like to activate a window of which the title contains the word (active)" and which ends with the word Pro/ENGINEER.

Al the other words in the title can be anything.

How do I Activate this window?

The AU3Info.exe info is listed below.

If wildcards where possible

something like:

WinActivate("*(Active)*Pro/ENGINEER")

WinWaitActive("*(Active)*Pro/ENGINEER")

would solve my problem.

But this doesnt seem to be the case.

Kind regards

GZE

WinActivate("*(Active)*Pro/ENGINEER")

WinWaitActive("*(Active)*Pro/ENGINEER")

Press CTRL-ALT-F to pause the display.

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: EO-049-094-007 (Active) C:\Ptc\models\Workdir_Concrete\EO-049-094_Laatste versie in work\EO-049-094-007.DRW.393 - Pro/ENGINEER

Class: Dialog

Size: X: 0 Y: 0 W: 1701 H: 1147

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Screen: X: 1069 Y: 12

Cursor ID: 2

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0x6E8FC0 Dec: 7245760

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size:

Control ID:

ClassNameNN:

Text:

>>>>>>>>>>> Status Bar Text <<<<<<<<<<<

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

Pro/ENGINEER

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<

Edited by GZE

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$Windows = WinList()

For $I = 1 to $Windows[0][0]
   If StringInStr($Windows[$I][0], "(active)") And StringInStr($Windows[$I][0], "Pro/ENGINEER") Then
      WinActivate($Windows[$I][0])
   EndIf
Next

Edited by Burrup

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

$Windows = WinList()

For $I = 1 to $Windows[0][0]
   If StringInStr($Windows[$I][0], "(active)") And StringInStr($Windows[$I][0], "Pro/ENGINEER") Then
      WinActivate($Windows[$I][0])
   EndIf
Next

<{POST_SNAPBACK}>

Hello

This workarround works great...

thnx al lot.

A WinActivate in which you could use wildcards would be more straightforward

not?

grtz,

GZE

Edited by GZE

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

or

opt('wintitlematchmode', 2)

winactivate("(Active)")

:)

or if that don't work then

opt('wintitlematchmode', 2)
$title = wingettitle("(Active)")
winactivate($title)

:evil:

Edited by WHRobin566

Witch Hunter Robin

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

@WHRobin566

First won't work because there may be other window's that have "(active)" in the title but don't have "Pro/ENGINEER". The second however, modified, will work.

Opt('WinTitleMatchMode', 2)
$Title = WinGetTitle("(Active)")
If StringInStr($Title, "Pro/ENGINEER") Then WinActivate($Title)

;Or

Opt('WinTitleMatchMode', 2)
$Title = WinGetTitle("Pro/ENGINEER")
If StringInStr($Title, "(Active)") Then WinActivate($Title)
Edited by Burrup

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

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