Lazarus

Free Pascal => Beginners => Topic started by: HobbyDev on March 20, 2017, 10:11:06 pm

Title: [solved] Shell_NotifyIcon which overloaded function do I have to take
Post by: HobbyDev on March 20, 2017, 10:11:06 pm
Hi all,

I am switching from an old Delphi Version to Lazarus. While compiling my app I get an error message saying Can't determine which overloaded function to call at this line
Code: Pascal  [Select][+][-]
  1. Shell_NotifyIcon(NIM_ADD, @TrayIconData);
The TrayIconData is defined in the private area of the Form as
Code: Pascal  [Select][+][-]
  1. TrayIconData     : TNotifyIconData;

I just don't know what to do in this case.

Any help would be helpful!
Regards HobbyDev
Title: Re: Shell_NotifyIcon which overloaded function do I have to take
Post by: balazsszekely on March 21, 2017, 06:19:14 am
Hi HobbyDev,

Welcome to the forum. Add shellapi to the interface section, declare TrayIconData as
Code: Pascal  [Select][+][-]
  1. TrayIconData: TNotifyIconDataW;
then call it like this:
Code: Pascal  [Select][+][-]
  1. Shell_NotifyIconW(NIM_ADD, @TrayIconData);

regards,
GetMem
Title: Re: Shell_NotifyIcon which overloaded function do I have to take
Post by: HobbyDev on March 21, 2017, 08:52:43 pm
 :) Many Thanks for the quick response! Will see, how it works if I got rid of all the compiler errors, this error message is gone!
TinyPortal © 2005-2018