Jump to content

nikolay_bu

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by nikolay_bu

  1. thank you for your response i was trying everything , now it worked
  2. Thank you very much everything work fine u are the best
  3. i was trying your script and im getting script paused problem please can you help me and i was traying to change the time to 3 min
  4. well, i will be very happy if you helped me i was trying all the scripts but im always having the script paused problem #include <Array.au3> #include <Timers.au3> #include <WinAPIProc.au3> Global $sProductFilePath = @WindowsDir Global $sProductFileName = "Notepad.exe" Global $sProductName = FileGetVersion($sProductFilePath & "\" & $sProductFileName, "ProductName") Global $hProcessWnd, $aProcessList, $idMsgBox Global $iTimerInit = TimerInit() Global $iIdleTime = _Timer_GetIdleTime() While 1 $aProcessList = ProcessList($sProductFileName) If $aProcessList[0][0] >= 2 Then $idMsgBox = MsgBox(48, $sProductName, "Multiple Licenses Detected" & @CRLF & @CRLF & "Due to license limitations only one copy of " & $sProductName & " is allowed." & @CRLF & @CRLF & "Please close additional copies of " & $sProductName) $iTimerInit = TimerInit() ContinueLoop EndIf $iProcessId = ProcessExists($sProductFileName) If $iProcessId Then $iIdleTime = _Timer_GetIdleTime() $hProcessWnd = _GetHwndFromPID($iProcessId) If WinActive($hProcessWnd ) Then $iTimerInit = TimerInit() EndIf ;~ If the timer is more than 40 minutes then send message to user and close the process, otherwise it closes within 5 minutes If TimerDiff($iTimerInit) >= 40 * 60 * 1000 Or $iIdleTime >= 40 * 60 * 1000 Then $idMsgBox = MsgBox(48, $sProductName, $sProductName & " has been idle for more than 40 minutes and will be closed in 5 minutes if no activity is detected.", 300) If $idMsgBox = -1 Then ProcessClose($sProductFileName) EndIf EndIf Sleep(100) WEnd ;Function for getting HWND from PID Func _GetHwndFromPID($_iProcessId) Local $_hProcessWnd Local $iWinList, $_aWinList = WinList() For $i = 1 To $_aWinList[0][0] If $_aWinList[$i][0] <> "" Then $iWinList = WinGetProcess($_aWinList[$i][1]) If $iWinList = $_iProcessId Then $_hProcessWnd = $_aWinList[$i][1] ExitLoop EndIf EndIf Next Return $_hProcessWnd EndFunc;==>_GetHwndFromPID
  5. I have a script paused for this one anyone have any idea ? I was changing the "payday" to the program name
  6. well I was trying a script from here to close the program when n activity but I had script paused problem
  7. can you please help me to use this script im having script paused problem
×
×
  • Create New...