Sign in to follow this  
Followers 0
SmOke_N

WinGetTitle

10 posts in this topic

At my wits end, and I know the answer is right under my nose:

From AutoInfo:

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

Title: The Window Title That Changes

Class: Abcd:200000:15:21102:0:8061d (8061d changes each time I log on; the rest is constant for Class)

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

Size:

Control ID:

ClassNameNN:

Text:

I'm trying to get the title name of the window, I was trying to use:

$Title = WinGetTitle(Classname="Abcd:200000:15:21102:0:8061d")

This works obviously, but again the last 5 digits change each time I log on, so it will only work in one instance.

How can I get a short version of ClassName= to work (yes I know it says must be "exact")? Anyone made a work around for this yet?


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites



If it's the active window you can use

$Title = WinGetTitle("")

<{POST_SNAPBACK}>

Yeh, I'm afraid I may have to revert to that. I wanted it to look more specific in case the users had other windows up rather than having to click on the window for "last" active.

Thanks though Gary


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Sad :) , thought Gary or Burrup would of gotten the one by now, if could be "gotten" (what a phrase).


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

:) <BUMP>

Anyone have any ideas other than: $Title = WinGetTitle("") ??

Sorry, but still banging my head against the wall here.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

:)  <BUMP>

Anyone have any ideas other than: $Title = WinGetTitle("") ??

Sorry, but still banging my head against the wall here.

<{POST_SNAPBACK}>

not sure... but this might shed some light

http://www.autoitscript.com/forum/index.ph...id=86125&st=0

hope it helps

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

Thanks Valuater, but: If you noticed the first post in my question there is no Control ID.

I have a "Class" Abcd:'whatever'&'end numbers', using "classname=Abcd:'whatever'", but the 'end numbers are always differnt. Looking for a way to only get the first few "letters" or "numbers" of the "Class". That's all I need to recognize that specific window regardless of the ' end numbers' all the time.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Sad :) , thought Gary or Burrup would of gotten the one by now, if could be "gotten" (what a phrase).

<{POST_SNAPBACK}>

Didn't know I was a part of this lol.

After reading over the topic and poking at MSDN a tiny bit, and a look in the help file, try this...

$WinList = WinList()

For $I = 0 To $WinList[0][0]
   $Class = WinGetClassName($WinList[$I][1])
   If StringLeft($Class, 23) = "Abcd:200000:15:21102:0:" Then
      $Title = WinGetTitle($WinList[$I][1])
      Msgbox(0,"Title", $Title)
   EndIf
Next

Func WinGetClassName($hwnd)
   Local $ret = DllCall("user32.dll","int","GetClassName","hwnd", $hwnd,"str","")
   If Not @error Then Return $ret[2]
EndFunc

Edit: Changed function name.

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

Just Awesome Burrup!


NEWHeader1.png

Share this post


Link to post
Share on other sites

Ok, I just got to try this:

Um... Great Job >>>>> Thanks!!

See why I said thought you or Gary would of whooped it already???

LOL


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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