[fpc-pascal] Windows API translation - or better way to update system tray?

Sven Barth pascaldragon at googlemail.com
Sun Oct 9 14:17:03 CEST 2011

On 09.10.2011 13:42, Reinier Olislagers wrote:
> However compiler errors on the 2nd nil:
>      (nil,nil,'Shell_TrayWnd', ''),nil,'TrayNotifyWnd',
> Error: Incompatible type for arg no. 2: Got "Pointer", expected "LongWord"
> Should I just pass 0 to those functions or bogus HWNDs... or do
> something else?
> (If you haven't figured it out by now, I understand C++ even less than
> Pascal ;)

That's not C++, but C, but in both "NULL" can be used for both: pointers 
and ordinals. In Pascal HWND is an ordinal and there the correct 
equivalent is of course "0". So yes, you should use "0". Maybe you'll 
need to do this for the first param as well.

As a sidenote: It's always good to inform oneself about the used 
functions using MSDN. There you'd see what the meaning of "0" or "NULL" 
in this function is. Here it is btw: 


More information about the fpc-pascal mailing list