我得到了以下代码,我认为这些代码正在生成"资源正忙着#34;因为它在定时器中不断重复。我用它来找出我试图自动告诉我并采取相应行动的网站。
任何人都可以告诉我如何修复代码或调试它?
procedure TimerAutoOKTimer(Sender: TObject);
const
Messagefromwebpage = 'Message from webpage';
var
wnd: hWnd;
begin
wnd := FindWindow(nil, Messagefromwebpage); // 'Message from webpage';
if wnd <> 0 then
begin
Memo1.Lines.Clear;
EnumChildWindows(wnd, @EnumChildrenProc, Integer(Memo1.Lines));
if POS('NOT possible', Memo1.Lines.Text)>0 then
SendMessage(Application.ActiveFormHandle, WM_COMMAND, ID_OK, 0);
if Pos('The webpage you are viewing is trying to close the window.', Memo1.Lines.Text)>0 then
SendMessage(Application.ActiveFormHandle, WM_COMMAND, ID_NO, 0);
end;
end;