Project JEDI - Issue Tracker - JEDI VCL
Viewing Issue Advanced Details
3747 00 JVCL Components minor sometimes 2006-06-06 10:44 2006-06-09 05:57
resolved Daily / GIT  
none 3.30  
0003747: JvTrayIcon - Problem when Shell_NotifyIcon(NIM_DELETE) does timeout.
Calling Shell_NotifyIcon can fail on XP when the shell is busy.
However, even when GetLastError() returns ERROR_TIMEOUT,
the icon can often be actually added(or deleted).

In the timeout of NIM_ADD, it can be confirmed that Shell_NotifyIcon(NIM_MODIFY) returns true and the addition of the icon has succeeded.
To similar, In the timeout of NIM_DELETE, it can be confirmed that Shell_NotifyIcon(NIM_MODIFY) returns false and the deletion of the icon has succeeded.

It fails even if NIM_DELETE is retried when the deletion of the icon
 has succeeded when NIM_DELETE does the time-out.
Therefore, the response doesn't return for 30 seconds.
And, even if the Active property is changed after that,
the icon cannot be added.

JvTrayIcon.pas Rev:10644
Workarounds :function TJvTrayIcon.NotifyIcon
    ErrorCode := GetLastError;
    if (ErrorCode = 0) or (ErrorCode = ERROR_TIMEOUT) then
      RetryCount := 0;
        case dwMessage of
          NIM_ADD: Result := Shell_NotifyIcon(NIM_MODIFY, @FIconData);
          NIM_DELETE: Result := not Shell_NotifyIcon(NIM_MODIFY, @FIconData);

        if Result then

        Result := Shell_NotifyIcon(dwMessage, @FIconData);
      until Result or (RetryCount > cMaxRetryCount);
Issue History
2006-06-06 10:44 ykami New Issue
2006-06-06 12:53 remkobonte Note Added: 0009393
2006-06-06 12:54 remkobonte Note Edited: 0009393
2006-06-07 09:38 ykami Note Added: 0009410
2006-06-09 05:57 obones Status new => resolved
2006-06-09 05:57 obones Resolution open => fixed
2006-06-09 05:57 obones Assigned To => obones

2006-06-06 12:53   
(edited on: 2006-06-06 12:54)
Okay, thanks, now I finally understand the text from;ja;418138 [^]

2006-06-07 09:38   
Working fine with rev. 10646. Thanks.