View Issue Details

IDProjectCategoryView StatusLast Update
0003747JEDI VCL00 JVCL Componentspublic2006-06-09 05:57
ReporterykamiAssigned Toobones 
Status resolvedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in Version3.30 
Summary0003747: JvTrayIcon - Problem when Shell_NotifyIcon(NIM_DELETE) does timeout.
DescriptionCalling 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
Additional InformationWorkarounds :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);
TagsNo tags attached.



2006-06-06 12:53

developer   ~0009393

Last edited: 2006-06-06 12:54

Okay, thanks, now I finally understand the text from;ja;418138


2006-06-07 09:38

reporter   ~0009410

Working fine with rev. 10646. Thanks.

Issue History

Date Modified Username Field Change
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