Has anybody else found that timer-driven events occasionally fail to occur in other applications when running the Lotus Notes client on your machine? The sign of it might be that a program hangs once in a while or some expected action never occurs.
I am experimenting with timer-driven programs on my desktop here. They invoke the Windows SetTimer function to set a timer and receive the ID of the timer in return. If the timer number is 1357 and Lotus Notes being used, then in many instances the timer will never fire for the process that set it, even if the timer is set for the minimum duration of 10 milliseconds. While not running Lotus Notes, I never see the problem. When I start Notes and bring up my inbox listing, I start to see the problem and it occurs intermittently from then until I exit Notes. Timer number 1357 seems to be the only one that is ever affected.
I’ve seen it on XP with Notes clients 6.5 and 5.0.10. I’ve heard of what sounds like the same problems on Windows NT4 and 2000.
Subject: Lotus Notes might kill timer 1357 on Windows
strange…
why is it nIDEvent 1357? is there any reason? most programs just use 1, 2, 3…
from win32 documenation for SetTimer:
If the hWnd parameter is not NULL and the window specified by hWnd already has a timer with the value nIDEvent, then the existing timer is replaced by the new timer. When SetTimer replaces a timer, the timer is reset. Therefore, a message will be sent after the current time-out value elapses, but the previously set time-out value is ignored.
maybe i’m wrong, but only reason where there could be some interaction would be when hWnd is set to Desktop Window?
applications using timers usually set them to there own windows. i don’t even know if it’s possible to set timers to windows owned by other threads…
maybe there’s some global hook involved that’s causing problems?
Subject: RE: Lotus Notes might kill timer 1357 on Windows
Thanks, Markus. I don’t know why it is 1357, but apparently it’s a widespread problem with Lotus Notes, because I described the problem to Microsoft without naming the third-party product I suspected and the first thing the MS engineer said was “Are you running Lotus Notes?”
My processes have no windows associated with them, so they call SetTimer with hWnd set to NULL. They also pass 0 as the timer ID, which means that SetTimer assigns the next unused timer ID to them. BTW, I found that the timer ID’s cycle from 32767 to 257 and then back around to 32767.
When I pass in a non-zero timer ID, but still a null window handle, SetTimer still returns the next available timer ID, not the one I passed in, so I don’t think Lotus Notes can be causing this problem by calling SetTimer with a null window handle and a requested Timer ID of 1357.
I see two possible ways that Lotus could be causing timer 1357 not to fire in one of my processes. The first one, that I know could happen, would be that Lotus issues a KillTimer for ID 1357 out of the blue. I know that works when I specify a null window handle. I don’t know what would happen if I specified a non-null window handle in the KillTimer call. Perhaps it would still kill the timer of the same ID, as long as it was set with a null window handle.
The second way is basically what you described. Perhaps because I specified a null window handle, Lotus Notes is able to “hijack” the timer by specifying the same timer ID, but with a non-null window handle.
I plan next to see whether I can add a dummy window to each of my processes that it can use to pass a non-null window handle to SetTimer. Then I will run my same experiments of setting and killing specific timers. I’ll post any interesting results.
Subject: RE: Lotus Notes might kill timer 1357 on Windows
from documentation:“The timer identifier, nIDEvent, is specific to the associated window. Another window can have its own timer which has the same identifier as a timer owned by another window.”
idea with dummy window should work.
beside that, i don’t know who’s to blame here. i’ve checked each user32.KillTimer call in nnotesws.dll (r6.03), they are all fixed (around 40 different values from 6h to 564d). didn’t find 1357. maybe notes doesn’t check if they are living timers. on the other side being able to reset other threads timers isn’t that nice and doesn’t fit in windows ui security scheme.