Thread: Tray Icon

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2007
    Posts
    169
    Rep Power
    37

    Tray Icon


    Hi all

    I have to following code

    with TrayIconData do begin cbSize := SizeOf(TrayIconData); Wnd := Handle; uID := 0; uFlags := NIF_MESSAGE + NIF_ICON + NIF_TIP; uCallbackMessage := WM_ICONTRAY; hIcon := Application.Icon.Handle; StrPCopy(szTip, Application.Title); end; Shell_NotifyIcon(NIM_ADD, @TrayIconData);
    i get an error to many parameters? cbSize := SizeOf(TrayIconData) giving me the problem. Thsi is weird. Any ideas.

    Ok thsi code still works on an earlier version of DELPHI. But now with DELPHI XE2 i get this.

    This is a piece of code that i use to minimize to the tray icon. COde i got form this site.

    http://delphi.about.com/library/code/ncaa121801a.htm
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2006
    Location
    Carlsbad, CA
    Posts
    2,055
    Rep Power
    383
    From release notes of XE2 (which we should all read and remember; but probably do not)

    SizeOf Problem for TNotifyIconData
    Due to changes in the Windows SDK, calling SizeOf(TNotifyIconData) will yield incorrect results on Windows versions prior to Windows Vista. Calling the TNotifyIconData.SizeOf method returns the correct size on all versions of Windows.
    Hope this solves it.

    Clive
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2007
    Posts
    169
    Rep Power
    37

    Re


    Hi Clive

    Thank you so much. You always have a answer for my problems. I really appreciate your time and effort you put into reading my questions and answering them as well.

    Thanks again

IMN logo majestic logo threadwatch logo seochat tools logo