Keep program active

Mar 5, 2015 at 8:50 AM
Hi,

Thanks for this great utility.
I was wondering if it would be possible to fool Internet Explorer into thinking it was active even though I am browsing pages in Firefox / writing e-mails etc..

Could be useful.

Best wishes,
Kare
Coordinator
Mar 5, 2015 at 11:59 AM
Hi,

If it was only IE that you were interested in, then you won't need Move Mouse for this.

The following script will launch an IE window, and continuously loop through the sites in the array (feel free to add/remove), leaving a 30 second pause between each navigation:
$Sites = @("http://movemouse.codeplex.com", "http://www.yahoo.com", "http://www.bbc.co.uk")
$Pause = New-TimeSpan -Seconds 30
$Ie = New-Object -ComObject "InternetExplorer.Application"
$Ie.Visible = $true

while ($true) {
    foreach ($Site in $Sites) {
        $Ie.Navigate2($Site)
        Start-Sleep -Seconds $Pause.TotalSeconds
    }
}
You won't need to have IE in the foreground for this script to work.

sw3103
Mar 7, 2015 at 3:29 PM
Thanks for this.

Actually I don't want it to loop through different sites, I only want it to think it's active in the one site that's open.

Kare
Coordinator
Mar 10, 2015 at 3:48 PM
Here is an adapted version of the script that will refresh the same site over and over every 30 seconds:
$Pause = New-TimeSpan -Seconds 30
$Ie = New-Object -ComObject "InternetExplorer.Application"
$Ie.Visible = $true
$Ie.Navigate2("http://movemouse.codeplex.com")

while ($true) {
    Start-Sleep -Seconds $Pause.TotalSeconds
    $Ie.Refresh()
}
Mar 12, 2015 at 10:23 AM
Thanks,

But I can't have it refresh the page in IE, it would break the session. Would it be possible to make a script that does key inputs in IE even though I am using other applications?

Best
Kare
Coordinator
Mar 14, 2015 at 4:42 PM

Hmmmm, not sure it will be possible to send keystrokes to an application which isn't in the foreground.

Marked as answer by sw3103 on 3/20/2017 at 2:24 PM