Lista winnt@man.lodz.pl
[Lista archiwów] [Inne Listy]

Re: [WINNT] Window 7 i pieprzone znikanie ikon z traya

To: winnt@man.lodz.pl
Subject: Re: [WINNT] Window 7 i pieprzone znikanie ikon z traya
From: "R.e.m.e.K" <pcisdead@wirtualnapolskaPOPRAWNAWP.pl>
Date: Wed, 24 Sep 2014 21:27:18 +0200
Dnia Wed, 24 Sep 2014 21:15:01 +0200, R.e.m.e.K napisał(a):

> Dnia 24 Sep 2014 15:20:01 GMT, Piotr B. [pb2004] napisał(a):
> 
>>> Jest to zatem fundamentalnie spieprzone.
>> 
>> Miało służyć do innych celów niż jest wykorzystywane.
> 
> Zaraz zaraz, a co z ikonami systemu? Od sieci czy od miksera audio. One sa
> na stale wbrew idei microsoftu?
>  
>>> Byc moze powinien, ale skoro malo ktory to robi (nawet microsoftowy Skype
>>> nie) to pewnie jest to glebszy problem.
>> 
>> Jest głębszy problem bo mało który program używa bezpośrednio Win32 Api 
>> tylko różnych warstw abstrakcji w których nie ma dostępu do wyniku 
>> funkcji Shell_NotifyIcon. Skype np. był pisany w Delphi.
> 
> Sugerujesz, ze aplikacje pisane w Delphi nie potrafia sprawdzic wyniku
> wywolania tej funkcji? Skad ten pomysl?
>  
>> W takim razie to raczej antywirus jest tutaj problemem choć nie 
>> spodziewałemm się że wąskim gardłem może być nawet SSD.
> 
> Dzis start byl juz opozniany i ikony sa, chyba wzystkie. Zobacze przez kilka
> dni, ale to chyba bedzie to.

No i chyba sie wyjasnilo, cytat ze strony MS:

"Handling Shell_NotifyIcon failure

Shell_NotifyIcon will often fail when called during Windows startup (for
instance, if your application is listed in
HKLM\Software\Microsoft\Windows\CurrentVersion\Run. This appears to be
because the system is busy starting applications. The failure is more common
on low-spec computers or computers with some brands of antivirus software
installed, which seem to be very intensive at startup.

Unfortunately, you cannot rely on the error code returned by GetLastError.
When Shell_NotifyIcon returns false, some of the common errors returned by
GetLastError are:

    ERROR_FILE_NOT_FOUND (2)
    ERROR_TIMEOUT (1460)
    ERROR_SUCCESS (0)

The most appropriate response to any error returned by Shell_NotifyIcon is
to sleep for a period of time and retry.

An explanation of why the error code may differ has been made by Paul Baker,
paraphrased from
http://groups.google.com/group/microsoft.public.platformsdk.shell/msg/59235b293cbf5dfa
and
http://groups.google.com/group/microsoft.public.platformsdk.shell/msg/73973287f15c03fc:

Shell_NotifyIcon actually calls SetLastError(0) initially. After that,
basically it uses FindWindow to find the tray notification window. If this
fails, it will typically return ERROR_FILE_NOT_FOUND. Otherwise it sends a
WM_COPYDATA message to the tray notification window, using
SendMessageTimeout with a timeout of only 4 seconds. If that message returns
zero, then Shell_NotifyIcon will fail with GetLastError returning zero.

reply to the above...
Applications that want to use the notification APIs that are running before
or during explorer startup should listen for the notification message that
indicates the taskbar is ready to receive API calls. This is the
“TaskbarCreated “ message. This also enables your application to re-register
if the explorer is re-started.
This is described in the section titled “Taskbar Creation Notification” on
this page:
http://msdn.microsoft.com/en-us/library/cc144179(VS.85).aspx"



-- 
pozdro
R.e.m.e.K

<Pop. w Wątku] Aktualny Wątek [Nast. w Wątku>