EXXON Posted January 31, 2007 Share Posted January 31, 2007 Hello, how can i get a Window title into a variable? thx in advance cul8er EXXON Link to comment Share on other sites More sharing options...
Krol Posted January 31, 2007 Share Posted January 31, 2007 $title = WinGetTitle( "title", ["text"] ) Link to comment Share on other sites More sharing options...
EXXON Posted January 31, 2007 Author Share Posted January 31, 2007 (edited) thx for the fast answer but: didn't need i the windows title for this function? I only know a part of the window title and i turned the option opt("WinTitleMatchMode", 1) on. Or could i change the option only at a part of my code? Edited January 31, 2007 by EXXON Link to comment Share on other sites More sharing options...
BrettF Posted January 31, 2007 Share Posted January 31, 2007 Read up in the helpfile on 'Window titles and Text' under 'Using AutoIT' Hope that Helps. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
EXXON Posted January 31, 2007 Author Share Posted January 31, 2007 think i have found it! $currentTitle = WinGetTitle ("active") Thx for the Help Link to comment Share on other sites More sharing options...
BrettF Posted January 31, 2007 Share Posted January 31, 2007 Thats ok. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
vinodkumarkp Posted February 2, 2007 Share Posted February 2, 2007 Hi , In my case the Title of the window keeps changing. The window title shows the percentage of download completed, which Varies from 0% to 100%. In addition it also displays the file name the outer application is downloading. Can you please suggest me what function can be used in this case. I got the process ID through Run() funtion while initiating the outer application. With Process ID, is it possible to get the Window handle and finally get the Window Title? Thanks and Regards, Vinod Kumar Link to comment Share on other sites More sharing options...
/dev/null Posted February 2, 2007 Share Posted February 2, 2007 Hi , In my case the Title of the window keeps changing. The window title shows the percentage of download completed, which Varies from 0% to 100%. In addition it also displays the file name the outer application is downloading. Can you please suggest me what function can be used in this case. the same function. "active" refers to the current active window. Opt("WinTitleMatchMode",4) $title = WinGetTitle("active") MsgBox(0,"TITLE",$title) __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
vinodkumarkp Posted February 2, 2007 Share Posted February 2, 2007 (edited) Hi dev, Thanks for the quick reply. But I am hiding the window when it starts with the Run () Function using @SW_HIDE. See the code below. $wget = """" & @WorkingDir & "\wget\wget.exe""" Global $WgetProcessName = Run($wget, @SW_HIDE) Thanks and Regards, Vinod Kumar Edited February 2, 2007 by vinodkumarkp Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 2, 2007 Moderators Share Posted February 2, 2007 (edited) Hi dev, Thanks for the quick reply. But I am hiding the window when it starts with the Run () Function using @SW_HIDE. See the code below. $wget = """" & @WorkingDir & "\wget\wget.exe""" Global $WgetProcessName = Run($wget, @SW_HIDE) Thanks and Regards, Vinod KumarThat code shows you are using @SW_HIDE for the Working directory parameter. Edit: You might want to take a look at ShellExecute. Edited February 2, 2007 by SmOke_N 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. Link to comment Share on other sites More sharing options...
/dev/null Posted February 2, 2007 Share Posted February 2, 2007 Hi dev, Thanks for the quick reply. But I am hiding the window when it starts with the Run () Function using @SW_HIDE. See the code below. $wget = """" & @WorkingDir & "\wget\wget.exe""" Global $WgetProcessName = Run($wget, @SW_HIDE) Thanks and Regards, Vinod Kumar Get a list of all windows with WinList(). That list will contain all window titles and HWNDs. Then walk trough the list and get the PID for each window with WinGetProcess() and compare that to your saved PID. If it matches, you have found the correct window. With the windows handle you can do whatever you want with the Win* functions. See also WinTitleMatchMode! __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
vinodkumarkp Posted February 2, 2007 Share Posted February 2, 2007 Hi Dev and SmOke_N, Thanks for the help. I used your method and I was able to solve the problem. But now I got a new problem. If ther are duplicate instances of the external application running. Then the programme is failing. Please have a look at the code below and let me know what I am doing wrong. Opt("SendKeyDelay", 0) Opt("SendKeyDownDelay", 0) Global $WgetProcessName = Run("Notepad.exe", "") If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","") WinWaitActive("Untitled - Notepad","") Send ("Process ID to Check for=" & $WgetProcessName & "{ENTER}",0) $var = WinList() For $i = 1 to $var[0][0] If $var[$i][0] <> "" Then $pid = WinGetProcess($var[$i][1]) If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","") WinWaitActive("Untitled - Notepad","") Send ("Process ID="& $pid & " {TAB}Handle=" & $var[$i][1] & " {TAB}Title=" & $var[$i][0] &"{ENTER}",0) If $pid = $WgetProcessName Then $Wget_win_handle = $var[$i][1] MsgBox (0,"",WinGetTitle ($Wget_win_handle)) EndIf ;~ MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1]) EndIf Next 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