Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003747 [JEDI VCL] 00 JVCL Components minor sometimes 2006-06-06 10:44 2006-06-09 05:57
Reporter ykami View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version Daily / GIT
Summary 0003747: JvTrayIcon - Problem when Shell_NotifyIcon(NIM_DELETE) does timeout.
Description 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
Additional Information Workarounds :function TJvTrayIcon.NotifyIcon
---------------------
    ErrorCode := GetLastError;
    if (ErrorCode = 0) or (ErrorCode = ERROR_TIMEOUT) then
    begin
      RetryCount := 0;
      repeat
        Sleep(cDelay);
        
        case dwMessage of
          NIM_ADD: Result := Shell_NotifyIcon(NIM_MODIFY, @FIconData);
          NIM_DELETE: Result := not Shell_NotifyIcon(NIM_MODIFY, @FIconData);
        end;

        if Result then
          Exit;

        Inc(RetryCount);
        Result := Shell_NotifyIcon(dwMessage, @FIconData);
      until Result or (RetryCount > cMaxRetryCount);
    end;
  end;
end;
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0009393)
remkobonte (developer)
2006-06-06 12:53
edited on: 2006-06-06 12:54

Okay, thanks, now I finally understand the text from http://support.microsoft.com/default.aspx?scid=kb;ja;418138 [^]

(0009410)
ykami (reporter)
2006-06-07 09:38

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


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker