Short answer: This can be fixed by lowering the priority of the timer so that it doesn't run while the menu thread is running:
SetTimer, Watch, 500, -1 ; Alternatively, you could raise the priority of each menu item.
Longer answer:
Landvermesser wrote:
It works fine (the user get the "OK" message) in version 1.0.33.0
It don't works in actual version (1.0.35.x and later)
I tested it on 1.0.33.0 and the MsgBox never appears (same behavior as later versions).
This is caused by the fact that the timer comes due while you're selecting the menu item. The sequence goes like this:
1) You select the item in the menu.
2) Your selection goes into the queue to await processing.
3) The program notices that your timer is overdue so runs it before the queued event. Note: Timers don't run while a menu is displayed, which is why it's almost always overdue at this point.
4) When the timer finishes, the queued event's menu item ID is now invalid because the timer deleted the old menu item and put one of the same name in its place. Therefore, the event is discarded.
Although I'm not sure if this behavior can be fixed, I'll look into it. Thanks for reporting it.