Well, all I can see is:
1. Your code is called in a complex environment (Java virtual machine) that can use multiple threads in W98 and can use multiple threads or fibers in WNT.
2. Your code frozes in FindWindow.
3. MSDN says that FindWindow uses GetWindowText and troubles with GetWindowText may cause troubles using FindWindow.
4. MSDN says that GetWindowText can froze when the window owns to the calling process but the window is frozen.
What I can suppose is:
1. There is a frozen window in your process, owned by a suspended thread.
2. When you call FindWindow you cause a WM_GETTEXT to be send to all windows in your process, including windows of suspended thread.
3. Your call is frozen waiting for the response from the suspended thread. If the suspended thread is a working communication thread that wakes up only when your thread ask for a service you have a deadlock
What I can suggest is:
1. Use MS Spy to verify if your process contains more than one thread. Verify if more than one thread ownes windows.
2. Use EnumWindows and verify the ownership of every window before calling GetWindowText. You must not call this function for windows belonging to other thread of your process. You can verify this conditions using GetWindowThreadProcessId and GetCurrentThreadId.
Good luck