type
NOTIFYICONIDENTIFIER = record
cbSize : DWORD;
hWnd : HWND;
uID : UINT;
guidItem: TGUID;
end;
PNOTIFYICONIDENTIFIER = ^NOTIFYICONIDENTIFIER;
function Shell_NotifyIconGetRect(const _in: NOTIFYICONIDENTIFIER; var _out: TRECT): HRESULT; stdcall;
implementation
{$R *.dfm}
function Shell_NotifyIconGetRect; external 'Shell32.dll' name 'Shell_NotifyIconGetRect';
procedure TForm1.SettingsClick(Sender: TObject);
var R: TRect;
S: NOTIFYICONIDENTIFIER;
begin
FillChar(S, SizeOf(S), #0);
S.cbSize := SizeOf(NOTIFYICONIDENTIFIER);
S.hWnd := form1.TextTrayIcon1.Handle;
S.uID := ??????;
if Shell_NotifyIconGetRect(S, R) = S_OK then
begin
Showmessage('OK!');
end
else Showmessage('ERROR!');
end;
我正在使用Delphi 7和CoolTrayIcon组件。我的目标是找到托盘图标位置,以便正确对齐表单。 问题:我在这里要添加什么? S.uID:= ??????; 我在TextTrayIcon组件中找不到与uID相关的任何内容。