Hi,

Also from debugging I see that when I click the systray Icon no message is sent to WndProc.

I passed the Window Handle to the Systray creation routine, so the messages should be coming.

By the way, MYWM_NOTIFYICON is declared as WM_USER + 77

Here is how I create the icon:

function TMainWindow.SetTaskbarIcon(uID: Cardinal): Boolean;
var
  tnid: TNotifyIconData;
begin
  // Fill TNotifyIconData
  tnid.cbSize := SizeOf(TNotifyIconData);
{$IFNDEF FPC}
  tnid.Wnd := Self.Handle;
{$ELSE}
  tnid.hWnd := Self.Handle;
{$ENDIF}
  tnid.uID := uID;
  tnid.uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;
  tnid.uCallbackMessage := MYWM_NOTIFYICON;
  tnid.hIcon := LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON2));
  tnid.szTip := szAppTitle;

  // Create Taskbar icon
  Result := Shell_NotifyIconA(NIM_ADD, @tnid);

  if (tnid.hIcon <> 0) then DestroyIcon(tnid.hIcon);
end;

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to