mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-20 07:59:37 +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
|
||||
*
|
||||
*******************************************************************}
|
||||
function EnumChildProc(handle : HWND; lp : LParam): LongBool; stdcall;
|
||||
var
|
||||
s : string;
|
||||
l : integer;
|
||||
function EnumChildProc(handle: HWND; lp: LParam): LongBool; stdcall;
|
||||
begin
|
||||
SetLength(s, 255);
|
||||
l := GetClassName(handle, PChar(s), Length(s));
|
||||
if l = 0 then Exit(False)
|
||||
if Pos('ToolbarWindow32', WndClassName(handle)) > 0 then
|
||||
begin
|
||||
LParam(Pointer(lp)^) := handle;
|
||||
Result := False;
|
||||
end
|
||||
else
|
||||
SetLength(s, l);
|
||||
if Pos('ToolbarWindow32', s) > 0 then
|
||||
begin
|
||||
lp := handle;
|
||||
result := false;
|
||||
end
|
||||
else
|
||||
result := true;
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
class function TWin32WSCustomTrayIcon.GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint;
|
||||
@ -450,7 +442,7 @@ begin
|
||||
hWndTray := ATrayIcon.Handle;
|
||||
|
||||
{ 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;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user