When Thunderbird is in the background but not hidden,
using the hotkey first hides it and restores it in the
foreground only at the second keypress. I'd rather
expect it to get to the foreground at the first one (as
I usually don't remember whether it is hidden or just
in the background). What about testing first, whether
Thunderbird is the foreground window
(GetForegroundWindow equals Thunderbird's hWnd) and
hide it only in that case, moving it to the front
otherwise?