Script by měl tuto aplikaci zavřít automaticky po 30 minutách pokud ji uživatel nepoužívá.
Šlo by něco podobného vytvořit?
Prosím o nějakou nápovědu jak na to

Díky
Moderátor: Moderátoři Živě.cz
public class FocusMonitor
{
public FocusMonitor()
{
AutomationFocusChangedEventHandler focusHandler = OnFocusChanged;
Automation.AddAutomationFocusChangedEventHandler(focusHandler);
}
private void OnFocusChanged(object sender, AutomationFocusChangedEventArgs e)
{
AutomationElement focusedElement = sender as AutomationElement;
if (focusedElement != null)
{
int processId = focusedElement.Current.ProcessId;
using (Process process = Process.GetProcessById(processId))
{
Debug.WriteLine(process.ProcessName);
}
}
}
}
#NoTrayIcon
;
; AutoIt Version: 3.3
; Language: English
; Platform: Win9x/NT
; Author: Lukas Ott
Dim $aktivniOkno
Dim $lastTitle
Dim $casovac
HotKeySet("{SCROLLLOCK}", "_Terminate")
$casovac = 60000
Program()
Func Program()
Local $aMgp = 0
Local $check = 0
Local $hDLL = DllOpen("user32.dll")
Local $hTimer = TimerInit()
While 1
If ProcessExists ( "Proces.exe" ) Then
$aktivniOkno = WinGetTitle( "[ACTIVE]" )
$check = StringInStr($aktivniOkno , "Proces")
$fDiff = TimerDiff($hTimer)
Sleep(10)
If NOT $check = 0 Then
If _IsPressed("25", $hDLL) Then
$hTimer = TimerInit()
Sleep(500)
Elseif _IsPressed("26", $hDLL) Then
$hTimer = TimerInit()
Sleep(500)
Elseif _IsPressed("27", $hDLL) Then
$hTimer = TimerInit()
Sleep(500)
Elseif _IsPressed("28", $hDLL) Then
$hTimer = TimerInit()
Sleep(500)
Elseif $fDiff >= $casovac Then
ProcessClose ( "Proces.exe" )
Sleep(500)
EndIf
Elseif $fDiff >= $casovac Then
ProcessClose ( "Proces.exe" )
Sleep(500)
EndIf
else
$hTimer = TimerInit()
Sleep(500)
EndIf
WEnd
EndFunc
Func _Terminate()
Exit
EndFunc ;==>_Terminate
Uživatelé procházející toto fórum: Žádní registrovaní uživatelé a 0 návštevníků