summaryrefslogtreecommitdiff
path: root/plugins/QuickSearch/sr_window.pas
diff options
context:
space:
mode:
authorAlexey Kulakov <panda75@bk.ru>2015-02-12 07:41:44 +0000
committerAlexey Kulakov <panda75@bk.ru>2015-02-12 07:41:44 +0000
commit20fdb92c777945d610dd14a3058689abf83eaf43 (patch)
tree9cce9046a23295ccf3e8df37dcbee241ec546a3e /plugins/QuickSearch/sr_window.pas
parent190df7e09c5d07330acd871c8ff842916f51d223 (diff)
QuickSearch: possible crash avoiding fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@12092 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/QuickSearch/sr_window.pas')
-rw-r--r--plugins/QuickSearch/sr_window.pas31
1 files changed, 17 insertions, 14 deletions
diff --git a/plugins/QuickSearch/sr_window.pas b/plugins/QuickSearch/sr_window.pas
index 16aa74bd2d..fa2a983367 100644
--- a/plugins/QuickSearch/sr_window.pas
+++ b/plugins/QuickSearch/sr_window.pas
@@ -1191,21 +1191,23 @@ begin
KillTimer(Dialog,TIMERID_HOVER);
if GetForegroundWindow<>mainwnd then exit;
i:=LV_GetLParam(grid,OldHItem);
- FillChar(info,SizeOf(info),0);
- with info do
+ if i>=0 then
begin
- cbSize :=SizeOf(info);
- hItem :=FlagBuf[i].contact;
- GetCursorPos(ptCursor);
- tmpCursor :=ptCursor;
+ FillChar(info,SizeOf(info),0);
+ with info do
+ begin
+ cbSize :=SizeOf(info);
+ hItem :=FlagBuf[i].contact;
+ GetCursorPos(ptCursor);
+ tmpCursor :=ptCursor;
{
- ptCursor.x:=loword(lParam);
- ptCursor.y:=hiword(lParam);
+ ptCursor.x:=loword(lParam);
+ ptCursor.y:=hiword(lParam);
}
- SendMessage(grid,LVM_GETITEMRECT,OldHItem,tlparam(@rcItem));
- ScreenToClient(grid,tmpCursor);
- if not PtInRect(rcItem,tmpCursor) then exit;
- end;
+ SendMessage(grid,LVM_GETITEMRECT,OldHItem,tlparam(@rcItem));
+ ScreenToClient(grid,tmpCursor);
+ if not PtInRect(rcItem,tmpCursor) then exit;
+ end;
// mGetMem(txt,16384*SizeOf(WideChar));
{
p:=txt;
@@ -1240,9 +1242,10 @@ end;
end;
p^:=#0;
}
- CallService(MS_TIPPER_SHOWTIPW,0{twparam(txt)},tlparam(@info));
+ CallService(MS_TIPPER_SHOWTIPW,0{twparam(txt)},tlparam(@info));
// mFreeMem(txt);
- TTShowed:=true;
+ TTShowed:=true;
+ end;
end;
end;