I have a program on my computer that, when its running, every few minutes a windows would pop up saying to "Continue free trial". I need an AHK code that states that, whenever this windows pops up while the program is running, to automatically press "Continue free trial". Can someone tell me the code to copy/paste into AHK script?
The program is called "Launch Wallpaper.exe", if that helps. Tell me if you need any other information for the script, like the .exe location or something.
What would be the AutoHotkey code to put in for this? Topic is solved
Re: What would be the AutoHotkey code to put in for this?
Try this:
Code: Select all
#SingleInstance, Force
#Persistent
SetTimer, Watchdog
Return
Watchdog:
If WinExist("ahk_exe Launch Wallpaper.exe")
ControlClick, Continue free trial
Return
Re: What would be the AutoHotkey code to put in for this?
What happens if you don't press Continue Free Trial? Having it pop up every few minutes would sound like it would be annoying. How about using WinHide, which would hopefully hide the window from your view, but also not have this program keep popping up new windows as a pop up is already present? I would guess this author wouldn't make it so someone who goes AFK for an hour or two comes back to a dozen or more pop ups of the same thing.
(Testing something: WinHide)
(Testing something: WinHide)
Re: What would be the AutoHotkey code to put in for this?
This doesn't work. There seems to be a misunderstanding in the code. The popup doesn't happen as soon as I open the program. It happens a few minutes after I open the program in a window. So, in the program, in a window, it says "Continue free trial" and I need a code that recognizes that when that popup comes up in the the program, to press "Continue free trial.wolf_II wrote:Try this:Code: Select all
#SingleInstance, Force #Persistent SetTimer, Watchdog Return Watchdog: If WinExist("ahk_exe Launch Wallpaper.exe") ControlClick, Continue free trial Return
Re: What would be the AutoHotkey code to put in for this? Topic is solved
Also, the popup windows title says "Video Wallpaper and Video Screensaver" (no quotes).africanking223 wrote:This doesn't work. There seems to be a misunderstanding in the code. The popup doesn't happen as soon as I open the program. It happens a few minutes after I open the program in a window. So, in the program, in a window, it says "Continue free trial" and I need a code that recognizes that when that popup comes up in the the program, to press "Continue free trial.wolf_II wrote:Try this:Code: Select all
#SingleInstance, Force #Persistent SetTimer, Watchdog Return Watchdog: If WinExist("ahk_exe Launch Wallpaper.exe") ControlClick, Continue free trial Return
Re: What would be the AutoHotkey code to put in for this?
try replacing one line:
Code: Select all
If WinExist("Video Wallpaper and Video Screensaver")
Re: What would be the AutoHotkey code to put in for this?
If I don't press "Coninue free trial" then nothing happens. I need to press "Coninue free trial" to continue the program. The program doesn't exit, it just stops.Exaskryz wrote:What happens if you don't press Continue Free Trial? Having it pop up every few minutes would sound like it would be annoying. How about using WinHide, which would hopefully hide the window from your view, but also not have this program keep popping up new windows as a pop up is already present? I would guess this author wouldn't make it so someone who goes AFK for an hour or two comes back to a dozen or more pop ups of the same thing.
(Testing something: WinHide)
Re: What would be the AutoHotkey code to put in for this?
Still doesn't work. Like I stated, the popup window opens a few minutes or so after I open the program LaunchWallpaper.exe . The windows name is Video Wallpaper and Video Screensaver. What I want to accomplish is, whenever this window popups up in the LaunchWallpaper program, I need the AHK code to automatically press Continue free trial. Is this possible or not?wolf_II wrote:try replacing one line:Code: Select all
If WinExist("Video Wallpaper and Video Screensaver")
Re: What would be the AutoHotkey code to put in for this?
If Window Spy can detect the popup window and the button, then it can be done easily. What info do you get from Window Spy?
(Window Spy is available via: Right click on the green "H"-icon in the systemtray)
(Window Spy is available via: Right click on the green "H"-icon in the systemtray)
Re: What would be the AutoHotkey code to put in for this?
never mind, it works now. I just happened to misspell something in the code. I have another question though. Is there anything I can add to the code to make it run everytime my computer starts? Also, is there anything I can add to the code to make the window, when it pops up, to not be the active window? The reason being I don't want the windows to interrupt me while I'm in the middle of playing a fullscreen game.wolf_II wrote:If Window Spy can detect the popup window and the button, then it can be done easily. What info do you get from Window Spy?
(Window Spy is available via: Right click on the green "H"-icon in the systemtray)
Re: What would be the AutoHotkey code to put in for this?
I know of no AHK code to prevent an external program from taking window focus when it pops up a window. The ControlClick should avoid AHK making the window active, but it won't stop your wallpaper program from making the window active.
You might get a quicker response by using WinWait in the timer, but it will still interrupt your game.
To make your script run when it autostarts, if you're not on Windows 10, stick the script itself or a shortcut (.lnk) to the script inside of your StartUp folder. On Windows 8.1 it is at %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup. Not sure if that's the same on other OS's.
You might get a quicker response by using WinWait in the timer, but it will still interrupt your game.
To make your script run when it autostarts, if you're not on Windows 10, stick the script itself or a shortcut (.lnk) to the script inside of your StartUp folder. On Windows 8.1 it is at %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup. Not sure if that's the same on other OS's.
Re: What would be the AutoHotkey code to put in for this?
And if you're on Windows 10?Exaskryz wrote:I know of no AHK code to prevent an external program from taking window focus when it pops up a window. The ControlClick should avoid AHK making the window active, but it won't stop your wallpaper program from making the window active.
You might get a quicker response by using WinWait in the timer, but it will still interrupt your game.
To make your script run when it autostarts, if you're not on Windows 10, stick the script itself or a shortcut (.lnk) to the script inside of your StartUp folder. On Windows 8.1 it is at %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup. Not sure if that's the same on other OS's.
Re: What would be the AutoHotkey code to put in for this?
Windows 10 does not play well with the start up I guess. I have not been on Windows 10 but have seen numerous reports on the AHK forums with people struggling to get their scripts to launch at start up. You might search the forums for a solution, if anyone has one. People have tried the Task Scheduler as a way to launch the AHK script, but that appears to not have worked.
Re: What would be the AutoHotkey code to put in for this?
There appears to be a bug in Windows 10 which prevents Task Scheduler from starting a script (such as a vbs or ahk file, not an executable) if the path or filename contains spaces.
It is not at all difficult to do on Windows 10, as long as you follow two rules:
It is not at all difficult to do on Windows 10, as long as you follow two rules:
- Do not set AutoHotkey.exe to "run as administrator".
If a program which requires admin rights is put in the Startup folder, Windows Vista will show a "blocked programs" popup showing that it prevented the program from starting. Windows 10 (and probably any versions in between) will just ignore the program. Some users set AutoHotkey.exe to run as administrator to work around some other problems, but there are better solutions. - If using Task Scheduler, set the task to launch a program, not a script/document.
In other words, set the target to AutoHotkey.exe and pass the script filename as a parameter.