Can anyone see what's wrong with it?
$Title = "BGInfo" While WinExists($Title) If WinExists($Title) Then WinActivate($Title) Send("{ESC}") Sleep(100) Else Exitloop EndIf WEnd
Edited by scanie, 24 May 2012 - 01:28 PM.
Posted 24 May 2012 - 01:27 PM
$Title = "BGInfo" While WinExists($Title) If WinExists($Title) Then WinActivate($Title) Send("{ESC}") Sleep(100) Else Exitloop EndIf WEnd
Edited by scanie, 24 May 2012 - 01:28 PM.
Posted 24 May 2012 - 01:37 PM
Ok, so I don't need the 'else'?
or alternatively:
bginfo /nolicprompt
Edited by scanie, 24 May 2012 - 01:41 PM.
Posted 24 May 2012 - 01:42 PM
Posted 24 May 2012 - 01:50 PM
The 'else' will never be true - right?
You can also substitute the ExitLoop with an Exit statement.
Edited by scanie, 24 May 2012 - 01:51 PM.
Posted 24 May 2012 - 02:06 PM
How to ask questions the smart way!
Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.
Posted 24 May 2012 - 02:59 PM
Edited by kaotkbliss, 24 May 2012 - 03:00 PM.
010101000110100001101001011100110010000001101001011100110010000001101101011110010010000001110011011010010110011100100001My first project Allin1 Program launcherBill CalculatorGot <Insert problem here>?There's an AutoIt script for that!
Posted 24 May 2012 - 06:58 PM
I'm using /taskbar /silent /timer:0 /nolicprompt. I have to put it in taskbar because our users are complaining about Win7 themes and backgrounds, they want to personalize their machines and they think that BGInfo on the wallpaper is interfering. If i launch BGInfo with these switches from the cmd prompt everything works OK, it ends up in the taskbar just as I want. But if I put it in the Startup folder it launches the popup automatically at logon.. That's why I created a little exe-file with autoit which is launched after BGInfo.What exactly are you attempting to do with BGInfo that isn't working the way you want it to? I understand there's a popup window you're getting when you run it, which by the way doesn't happen for me if I use bginfo /taskbar. But what exactly is it doing that you don't want it to do?
The script works fine if anything is on top of it, at least when I do everything manually. I tested by putting several windows on top of the BGInfo window and then executed the script. It brought BGInfo to front and closed it. But if I do the same thing automatically with just two lines of batch code at logon, it doesn't work.I'll try to explain the best I can
in this script
if the popup is not there yet when autoit runs, it will hit the else condition (because the win does not exist) and exit. So when it does pop up, autoit is already done and can't close it.
for the 2nd part (it doesn't work if another window is on top of it)
you may try control sending the esc to the window instead of just send, or you could use WinSetOnTop before the activate and send.
Posted 24 May 2012 - 07:06 PM
How to ask questions the smart way!
Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.
Posted 25 May 2012 - 07:40 AM
You either need a Sleep in there before the While loop, to give the BGInfo window time to open or use a WinWait with a timeout, before it to make sure the window is there when the script runs, if you run it right after running the program, the window may not exist yet, so the script ends.
Edited by scanie, 25 May 2012 - 07:41 AM.
Posted 25 May 2012 - 12:45 PM
How to ask questions the smart way!
Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.
Posted 25 May 2012 - 10:54 PM
Edited by Decipher, 25 May 2012 - 10:56 PM.
Posted 26 May 2012 - 10:14 PM
s!mpL3 LAN MessengerCurrent version 2.9.7.7 [15/02/2013]Download HeresimpL3
Posted 28 June 2012 - 09:19 AM
Posted 28 June 2012 - 01:27 PM
How to ask questions the smart way!
Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.
Posted 29 June 2012 - 07:30 AM
Instead of using WinActivate and sending Escape, try using ProcessClose("bginfo.exe") and see if that works.
Posted 29 June 2012 - 01:00 PM
How to ask questions the smart way!
Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.
Posted 29 June 2012 - 01:21 PM
The organization that hires me doesn't want BGInfo on the wallpaper. They want in the taskbar. BGInfo supports this but it only works as intended on XP. On XP the application starts minimized to the taskbar automatically. On Win7 it starts in a window AND in the taskbar, if you close the window it stays in the taskbar but if you kill the process you close both the window and the icon in the taskbar.Why do you want it to stay running? BGinfo merely sets the desktop background image to whatever you've set it to display, once it's done that it has no further functionality. Also hitting escape when the window is open on my system closes it and the program stops running. I see nothing in the system tray even when it's running. What is in your shortcut that keeps it open, and what is it doing that you need it to stay running for?
C:BGInfoBginfo.exe C:BGInfotaskbar_settings.bgi /taskbar /timer:0 /nolicprompt
Posted 29 June 2012 - 02:45 PM
The loop will not even start with WinExists(). Instead use WinWaitActive().
Run(@ComSpec & " /c " & "C:\BGInfo\Bginfo.lnk", @TempDir, @SW_HIDE) $Title = "BGInfo" WinWait($Title, "", 60) WinActivate($Title) WinWaitActive("title", "", 10) Send("{ESC}")
Posted 29 June 2012 - 03:12 PM
Yes, that works. I have tried it. But then the app closes for good, I want it to stay in the system tray.
Good suggestion though!
Edited by mechaflash213, 29 June 2012 - 03:12 PM.
0 members, 0 guests, 0 anonymous users