Показать полную графическую версию : [решено] Отслеживание зависания процесса
support23
03-10-2012, 09:13
Доброго дня !
Есть процесс, периодически зависает и не реагирует на нажатия мыши.
Как можно отследить эти зависания? можно ли контролировать проверку потребляемой памяти, если не изменяется в течении определенного времени, то выдавать сообщение ?
$hWin = WinGetHandle (http://autoit-script.ru/autoit3_docs/functions/WinGetHandle.htm)('My Window')
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) _WinAPI_IsHungAppWindow($hWin) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then)
MsgBox (http://autoit-script.ru/autoit3_docs/functions/MsgBox.htm)(48, '', 'Окно зависло')
EndIf (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndIf)
Func (http://www.autoitscript.com/autoit3/docs/keywords.htm#Func) _WinAPI_IsHungAppWindow($hWnd)
Local (http://www.autoitscript.com/autoit3/docs/keywords.htm#Local) $aRet = DllCall (http://autoit-script.ru/autoit3_docs/functions/DllCall.htm)('user32.dll', 'int', 'IsHungAppWindow', 'hwnd', $hWnd)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) @error (http://autoit-script.ru/autoit3_docs/macros.htm#@error) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then)
Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) SetError (http://autoit-script.ru/autoit3_docs/functions/SetError.htm)(1, 0, 0)
EndIf (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndIf)
Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) $aRet[0]
EndFunc (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndFunc)
support23
04-10-2012, 08:34
Спасибо!очень помогли!
© OSzone.net 2001-2012
vBulletin v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.