summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/QuickSearch/sr_window.pas31
-rw-r--r--plugins/Utils.pas/wrapper.pas6
2 files changed, 21 insertions, 16 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;
diff --git a/plugins/Utils.pas/wrapper.pas b/plugins/Utils.pas/wrapper.pas
index 0a8090b105..c6d0c5976d 100644
--- a/plugins/Utils.pas/wrapper.pas
+++ b/plugins/Utils.pas/wrapper.pas
@@ -342,8 +342,10 @@ begin
li.iItem :=item;
li.mask :=LVIF_PARAM;
li.iSubItem:=0;
- SendMessageW(list,LVM_GETITEMW,0,lparam(@li));
- result:=li.lParam;
+ if SendMessageW(list,LVM_GETITEMW,0,lparam(@li))=0 then
+ result:=-1
+ else
+ result:=li.lParam;
end;
function LV_SetLParam(list:HWND;lParam:LPARAM;item:integer=-1):LRESULT;