* Check if this window is the Shell's Desktop Window. If so set hShellWindow to NULL
*/
- if ((ti != NULL) && (ti->pDeskInfo != NULL))
+ if (ti->pDeskInfo != NULL)
{
if (ti->pDeskInfo->hShellWindow == hWnd)
{
/* Send destroy messages */
IntSendDestroyMsg(UserHMGetHandle(Window));
- // Destroy the default IME window if necessary
+ /* Destroy the default IME window if necessary */
if (IS_IMM_MODE() && !(ti->TIF_flags & TIF_INCLEANUP) &&
- ti->spwndDefaultIme && !IS_WND_IMELIKE(Window) && !(Window->state & WNDS_DESTROYED))
+ ti->spwndDefaultIme && (ti->spwndDefaultIme != Window) &&
+ !(Window->state & WNDS_DESTROYED) && !IS_WND_IMELIKE(Window))
{
if (IS_WND_CHILD(Window))
{