Can someone explain why the following locks up the main UI thread? I have a worker thread that may display a message in a form of a popup balloon. To do so I send a private message from this worker thread into the main UI thread like this: Code: CWnd* pMainWnd = AfxGetMainWnd(); pMainWnd->SendMessage(MY_MESSAGE_POPUP_BALLOON, (WPARAM)pBalloonText, nBalloonIcon); The main thread processes this message by filling out the NOTIFYICONDATA and calling Shell_NotifyIcon(NIM_MODIFY). Then it returns. The code above works on Windows XP. It works under Vista if a desktop is active. But in case the request to show a popup balloon is broadcast while that user's desktop is not active it deadlocks the main thread. (I can tell that when I switch users and the app is not responding, although CPU usage remains at 0%.) It really baffles me..... what's going on?