barbod_ahmadi
دوشنبه 09 خرداد 1384, 03:01 بعد از ظهر
• چگونه می توان تشخیص داد که برنامه ای به خوبی در حال اجراست یا اینکه پاسخ نمیدهد ؟
با یستی از تابع SendMessageTimeOut استفاده کرد :
Function isHung(theWindow: HWnd; timeout : longint) : Boolean
Var
dwResult : DWord ;
begin
Result := SendMessageTimeout ( theWindow , WM_ NULL , 0 , 0 ,
SMTO_ABORTIFHUNG or SMTO_ BLOCK , timeout , dwResult) <> 0 ;
End;
با یستی از تابع SendMessageTimeOut استفاده کرد :
Function isHung(theWindow: HWnd; timeout : longint) : Boolean
Var
dwResult : DWord ;
begin
Result := SendMessageTimeout ( theWindow , WM_ NULL , 0 , 0 ,
SMTO_ABORTIFHUNG or SMTO_ BLOCK , timeout , dwResult) <> 0 ;
End;