mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-23 10:59:31 +01:00
win32: redo TWin32WSCustomTrayIcon.GetPosition based on description. It passed a variable by value and assigned it in enum proc. This code could never return any other value than passed.
git-svn-id: trunk@29280 -
This commit is contained in:
parent
bc0c4be8ea
commit
a775500c43
@ -413,23 +413,15 @@ end;
|
|||||||
* the icon
|
* the icon
|
||||||
*
|
*
|
||||||
*******************************************************************}
|
*******************************************************************}
|
||||||
function EnumChildProc(handle : HWND; lp : LParam): LongBool; stdcall;
|
function EnumChildProc(handle: HWND; lp: LParam): LongBool; stdcall;
|
||||||
var
|
|
||||||
s : string;
|
|
||||||
l : integer;
|
|
||||||
begin
|
begin
|
||||||
SetLength(s, 255);
|
if Pos('ToolbarWindow32', WndClassName(handle)) > 0 then
|
||||||
l := GetClassName(handle, PChar(s), Length(s));
|
begin
|
||||||
if l = 0 then Exit(False)
|
LParam(Pointer(lp)^) := handle;
|
||||||
|
Result := False;
|
||||||
|
end
|
||||||
else
|
else
|
||||||
SetLength(s, l);
|
Result := True;
|
||||||
if Pos('ToolbarWindow32', s) > 0 then
|
|
||||||
begin
|
|
||||||
lp := handle;
|
|
||||||
result := false;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
result := true;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TWin32WSCustomTrayIcon.GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint;
|
class function TWin32WSCustomTrayIcon.GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint;
|
||||||
@ -450,7 +442,7 @@ begin
|
|||||||
hWndTray := ATrayIcon.Handle;
|
hWndTray := ATrayIcon.Handle;
|
||||||
|
|
||||||
{ Then we locate inside the Tray area, which is just a Toolbar control }
|
{ Then we locate inside the Tray area, which is just a Toolbar control }
|
||||||
EnumChildWindows(hWndTaskbar, @EnumChildProc,LParam(hWndTray));
|
EnumChildWindows(hWndTaskbar, @EnumChildProc, LParam(@hWndTray));
|
||||||
|
|
||||||
if hWndTray = 0 then Exit;
|
if hWndTray = 0 then Exit;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user