Jump to content
Sign in to follow this  
pallavii

Auto close when application is idle

Recommended Posts

hi all,

         in my script, i want to close the application/file, when application is idle,... opened application is not closed pls anyone help...☹️

 

<#include <File.au3>
#Include <Array.au3>
#include <Timers.au3>
#include <MsgBoxConstants.au3>
#include <WinAPISys.au3>
Local $path = "D:\CTS ppt"
Local $FileArray = _FileListToArrayRec($path, '*.ppsx', 1)
For $i = 1 To $FileArray[0]
    If StringInStr($FileArray[$i], ".ppsx") > 0 Then
        $ppsx =ShellExecuteWait($path & "\" & $FileArray[$i])
        Send("{F5}")
        While 1
            If _WinAPI_GetIdleTime() >= 1 * 30 * 1000 Then
                ;MsgBox (0, "Time reached", "You have been idle.")
                WinClose($FileArray[$i])
            EndIf
            Sleep(10 * 1000)
        WEnd
    EndIf
Next>

Share this post


Link to post
Share on other sites

WinClose is wrong, you may want to use PP class, like :

WinClose ("[CLASS:PP11FrameClass]")

Use Au3Info.exe tool to get the class of your version.

Post your code this way.

Edited by Nine

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...