tags:

views:

197

answers:

2

We have a bizarre and very infrequent issue where people can't log off the Windows server when our product is running. The system is multi-application, all MFC/C++. The apps are run from a management service so they survive logoff. It's been running fine for donkeys years in loads of installations around the world.

I wrote a test application to enumerate all windows, send them a WM_QUERYENDSESSION message, and stop when it returns FALSE. This test is being run on one of these rare case where the problem repros, in Germany. It always seems to be an invisible IME (Input Method Editor) window which is the guilty party, but the IME window always belongs to one of our MFC applications. I think I can solve the problem for an individual application by calling ImmDisableIME (-1). But what I'm looking for is...

(a) if someone has a configuration method to get around this so we don't have to modify all the versions of all the applications for all the countries - a large job.

(b) Why this should happen in the first place. Why should an IME window we didn't create decide that the user can't log off?

(c) Has anyone else ever seen this before? Misery loves company, you know.

As stated, currently it's happening on one machine in Germany. Of course we can't repro here, on any version of Windows. Bah.

A: 

Another suggestion:

If you know which window is at fault and it's the same one every time you can try sub-classing the window and handling the WM_QUERYSESSIONEND message directly. This takes the IME window out of the equation and should be a fairly maintainable solution.

JaredPar
I was hoping there was some way to configure IME or Windows itself to prevent the issue system-wide, I _really_ don't want to mod code for around 30 server side MFC apps without a really good reason :-). I'll consider it though...
Bob Moore
@Bob, there may be. I'm somewhat unfamiliar with IME.
JaredPar
+2  A: 

It would seem that Microsoft have encountered some of these problems with various versions of the IME. I found some relatively old updates. What OS is your customer running and do they have version(s) of Office installed? Is it possible to determine the filename and version of the module creating the IME window in your case?

Here is an update related to the IME from Office 2003:

Microsoft Known Bug 870774

The message box takes 30 seconds to close when you shutdown Windows

When you try to shutdown a Japanese Windows 2000-based computer that has the Office 2003 framework that is used to support advanced text services installed without first closing all your open programs, you receive a message box for each open program. When you click End, it takes approximately 30 seconds to close each message box before Windows can shutdown.

  File name   Version
   -----------------------
   Msctf.dll   5.1.2409.39
   Msimtf.dll  5.1.2409.39
   Input.cpl   5.1.2409.39
   Sptip.dll   5.1.2409.39

Here is an update which relates to the Windows XP IME:

Microsoft Known Bug 811147

Windows Messenger Hangs During Shutdown and a Terminate Program Dialog Box Appears

   Date         Time   Version     Size     File name
   ----------------------------------------------------
   17-Jan-2003  15:36  8.1.4008.0   57,400  Cplexe.exe
   17-Jan-2003  15:34  8.1.4008.0  335,917  Imjp81.ime
   06-Feb-2003  13:56  8.1.4008.0  827,438  Imjp81k.dll
   06-Feb-2003  13:56  8.1.4008.0  360,494  Imjpcic.dll
   06-Feb-2003  13:56  8.1.4008.0  716,857  Imjpcus.dll
   06-Feb-2003  13:56  8.1.4008.0   81,977  Imjpdct.dll
   22-Jan-2003  09:52  8.1.4008.0  307,258  Imjpdct.exe
   17-Jan-2003  15:36  8.1.4008.0  155,706  Imjpdsvr.exe
   17-Jan-2003  15:36              196,666  Imjpinst.exe
   17-Jan-2003  15:36  8.1.4008.0  208,953  Imjpmig.exe
   17-Jan-2003  15:36  8.1.4008.0  233,528  Imjprw.exe
   17-Jan-2003  15:36  8.1.4008.0  262,201  Imjputy.exe
   06-Feb-2003  13:56  8.1.4008.0  274,490  Imjputyc.dll
   14-Nov-2002  10:01  5.3.10.0      4,608  Spmsg.dll
Heath Hunnicutt
They're unlikely to have Office installed on a server, but it's worth checking. I'll also have them turn off advanced text services and see if that makes a difference.
Bob Moore
Yeah, I got notification from Germany that turning off advanced text services solves the problem, so I'll accept this one.
Bob Moore
Rats, SO won't let me upvote (too old), but I accepted anyway.
Bob Moore