olivarra1 Posted April 15, 2008 Share Posted April 15, 2008 I searched a Function that gives me the handle and the tittle of the active window and i haven't found it, so I made it. it took me few minutes: Func _WinActivated() Local $return[2] Local $windows = WinList() Local $i for $i = 1 to $windows[0][0] if Winactive($windows[$i][1]) then $return[0] = $windows[$i][0] $return[1] = $windows[$i][1] ExitLoop EndIf if $i = $windows[0][0] Then $return[0] = -1 $return[1] = -1 EndIf Next Return($return) EndFunc It returns an array, $return[0] is the window's title and $return[1] is the window's handle. if error, then sets the two values to -1. olivarra1 Link to comment Share on other sites More sharing options...
McGod Posted April 15, 2008 Share Posted April 15, 2008 Function WinGetTitleWinGetTitle("") returns the active window's title. So, something like this. Func _Activated () Local $sRet[2] $sRet[0] = WinGetTitle("") $sRet[1] = WinGetHandle($sRet[0]) Return $sRet EndFunc [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u] Link to comment Share on other sites More sharing options...
olivarra1 Posted April 15, 2008 Author Share Posted April 15, 2008 Function WinGetTitle[ left]WinGetTitle("") returns the active window's title. mhh autoit help doesn't say it WinGetTitle -------------------------------------------------------------------------------- Retrieves the full title from a window. WinGetTitle ( "title" [ , "text"] ) Parameters title The title of the window to read. See Title special definition. text [ optional] The text of the window to read. But it's kinda confusing, because how can you know the window's title using a function that asks you the window's title? well so thank you ^^ olivarra1 Link to comment Share on other sites More sharing options...
Siao Posted April 15, 2008 Share Posted April 15, 2008 Read the "Title special definition" article which is linked from every Win...() function. WinGetHandle("[ACTIVE]") WinGetTitle("[ACTIVE]") "be smart, drink your wine" Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now