autoit0822 Posted August 22, 2009 Share Posted August 22, 2009 After using WinSetState to minimize a window, then wait 50 seconds before closing it, is there a way I can change the title of the window to count down from 50 seconds until the window closes? Link to comment Share on other sites More sharing options...
BrettF Posted August 22, 2009 Share Posted August 22, 2009 WinSetTitle? While/For Loop Sleep 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...
autoit0822 Posted August 22, 2009 Author Share Posted August 22, 2009 Can you provide an example for me, please? Link to comment Share on other sites More sharing options...
CodyBarrett Posted August 22, 2009 Share Posted August 22, 2009 (edited) um... its quite simple.. Brett gave you everything you needed to make your own code... but if its an example you need to get started on... alright $title = wingettitle ('[active]','') For $0 = 10 To 0 Step -1 winsettitle (WinGetTitle ('[active]',''),'', $0) sleep (1000) Next winsettitle (WinGetTitle ('[active]',''),'', $title) Edit typo Edited August 22, 2009 by CodyBarrett [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
autoit0822 Posted August 22, 2009 Author Share Posted August 22, 2009 Thanks; I gave that a go, but it seems that once the window is minimized, it's no longer the active one, meaning that another window starts counting down. Here's what I have: WinSetState("[current title]", "", @SW_MINIMIZE) $title = wingettitle ('[active]','') For $0 = 50 To 0 Step -1 winsettitle (WinGetTitle ('[active]',''),'', $0) sleep (1000) Next winsettitle (WinGetTitle ('[active]',''),'', $title) WinClose("[what goes here]") Link to comment Share on other sites More sharing options...
CodyBarrett Posted August 22, 2009 Share Posted August 22, 2009 it was an example.. instead of the Active use the window title of your prefered window title OR handle lol [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
autoit0822 Posted August 22, 2009 Author Share Posted August 22, 2009 OK, I changed instances of [active] to the current title, but there is no countdown at all; the window title is static. Link to comment Share on other sites More sharing options...
autoit0822 Posted September 3, 2009 Author Share Posted September 3, 2009 I have the following code working in Windows XP: Run("cmd.exe") Sleep(500) Send("Telnet 192.168.1.1") Send("{ENTER}") Sleep(1000) WinSetState("Telnet 192.168.1.1", "", @SW_MINIMIZE) For $i = 50 To 0 Step -1 $Title = WinGetTitle('Telnet 192.168.1.1') WinSetTitle($Title,'', 'Telnet 192.168.1.1 ' & $i) Sleep(1000) Next WinClose("Telnet 192.168.1.1") However, in Windows Vista, where I need it to work, the window title remains static. Link to comment Share on other sites More sharing options...
WolfWorld Posted September 3, 2009 Share Posted September 3, 2009 Good Luck and start looking in the damn help file. Run("cmd.exe") Sleep(500) Send("Telnet 192.168.1.1") Send("{ENTER}") Sleep(1000) $hWin = WinGetHandle("Telnet 192.168.1.1") WinSetState($hWin , "", @SW_MINIMIZE) For $i = 50 To 0 Step -1 WinSetTitle($hWin, '', 'Telnet 192.168.1.1 ' & $i) Sleep(1000) Next WinClose($hWin) Main project - Eat Spaghetti - Obfuscate and Optimize your script. The most advance add-on.Website more of GadGets! Link to comment Share on other sites More sharing options...
autoit0822 Posted September 3, 2009 Author Share Posted September 3, 2009 Good Luck and start looking in the damn help file.Thanks, I think; it might help if I knew where in the help file to look. Anyhow, this doesn't work in Vista; the window title remains static. Link to comment Share on other sites More sharing options...
dbzfanatic Posted September 3, 2009 Share Posted September 3, 2009 Search for "title" in the helpfile and for vista try adding #RequireAdmin to the top of your code. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
autoit0822 Posted September 3, 2009 Author Share Posted September 3, 2009 (edited) Search for "title" in the helpfile and for vista try adding #RequireAdmin to the top of your code.Looking at Window Titles and Text (Advanced), I can't find anything that would indicate why this script would not work as intended in Vista. The default WinTitleMatchMode, which matches partial titles from the start, would seem appropriate.I had considered running the script with elevated privileges, but it makes no difference.I had thought WolfWorld had posted a solution for me, editing the script as he did. Edited September 3, 2009 by autoit0822 Link to comment Share on other sites More sharing options...
dbzfanatic Posted September 3, 2009 Share Posted September 3, 2009 I'm not sure why it wouldn't work if it's not a privileges issue. I'd rather not switch my laptop over to vista just to check it out, but I have a question. Are you running the script from SciTe in vista or have you compiled an .exe file that you're using? I've had experiences where an .exe I compiled in XP wouldn't run in vista but when recompiled in vista with identical code it worked. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
autoit0822 Posted September 3, 2009 Author Share Posted September 3, 2009 I'm not sure why it wouldn't work if it's not a privileges issue. I'd rather not switch my laptop over to vista just to check it out, but I have a question. Are you running the script from SciTe in vista or have you compiled an .exe file that you're using? I've had experiences where an .exe I compiled in XP wouldn't run in vista but when recompiled in vista with identical code it worked.I have compiled a .exe file in Vista that only works in my XP VM. Link to comment Share on other sites More sharing options...
dbzfanatic Posted September 3, 2009 Share Posted September 3, 2009 Thanks for reminding me about VMs. I'll boot up my vista VM and try the code to see if I can replicate your error. Give me 5 minutes to post. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
WolfWorld Posted September 3, 2009 Share Posted September 3, 2009 I have Win7 and it worked perfectly. Main project - Eat Spaghetti - Obfuscate and Optimize your script. The most advance add-on.Website more of GadGets! Link to comment Share on other sites More sharing options...
dbzfanatic Posted September 3, 2009 Share Posted September 3, 2009 Is this a clean install of Vista? Sorry for the delay my VM choked and I had to redo it and install autoit. If it is you might have this problem: 'telnet' is not recognized as an internal or external command, operable program, or batch file. Does the window connect, as in do you have telnet? Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
autoit0822 Posted September 3, 2009 Author Share Posted September 3, 2009 Is this a clean install of Vista? Sorry for the delay my VM choked and I had to redo it and install autoit. If it is you might have this problem: 'telnet' is not recognized as an internal or external command, operable program, or batch file.Does the window connect, as in do you have telnet?Yes, telnet is enabled and working; the only issue is with the countdown not appearing in the window title. 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