Jump to content

Ignore a portion of a window in WinActivate


Recommended Posts

Hey,

I just discovered AutoIt and have fallen for it. I'm new to the forums, too, and appreciate any help.

I'm trying to activate a window using WinActivate. The title of the window contains a section in brackets that I'd like to ignore. Esentially, I want to be able to search for "Window Title Part One (ignore this) And Part Two".

I know this can be done using regex, but don't know how to go about it.

Thanks for any help.

Link to comment
Share on other sites

WinList()
For To
    If StringInStr() Then
;       ...
    EndIf
Next

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

Yeah... StringInStr() would work with an If... But I already know the title bar has the string I need... It just changes with each (regular) revision.

Currently it's "Example title bar (V 12.34) Following Text"... But it's also been "Example title bar (Ver 12.34b) Following Text". So really, I'm looking to trigger WinActivate(), using "Example title bar ({wildcard}) Following Text"

Link to comment
Share on other sites

so your telling me that you cant trigger title that you need with

If StringInstr($var,'Example title bar (') And StringinStr($var,') Following Text') Then WinActivate($var)

?!

If you cant maby its best for you to look under "Window Titles and Text (Advanced)" in help file

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

what about using

AutoItSetOption("WinTitleMatchMode",2)

then you could do

$title = WinList( "Example title bar")

*edit to expand on that*

$title will become an array of all the windows that have "Example title bar" somewhere in the title and you can then WinActivate from that list

Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to comment
Share on other sites

something like REGEXPTITLE:test(.*?)goo tor title named like test aaa goo.txt shud work if im not wrong (or many im worng, did i already tell anyone that i will newer learn StringRegExp? :D )

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

  • Moderators

bogQ,

i will newer learn StringRegExp

I do not want to hijack the thread, but try ressions.info/tutorial.html'>this site - the best SRE tutorial I have come across. :oops:

M23

P.S. And do not forget GEOSoft's PCRE Toolkit - look in his sig. :D

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

your telling me that REGEXPTITLE:test(.*?)goo will work? or itl not work and your redirecting me to learn more :D

eather way i will try to wrap my mind around it in the near future, ty for the link :oops:

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

  • Moderators

bogQ,

your telling me that REGEXPTITLE:test(.*?)goo will work? or itl not work and your redirecting me to learn more

Neither - just pointing you to a good resource. :D

And now back to our scheduled programming...pun fully intended! :oops:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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