Anyway I wrote a test app, showwindow.c. It is available on ftp://resnet.dnip.net . The relay log is there too. The test app tries to mimic the calls I see. I tested under wine and it does hang. I will see about windows.
I don't know if I did it right. I created an empty Win32 application with VC6, added your file, added an #include <stdio.h> for printf and compiled it successfully. Upon running a window shortly flashes up and the program ends, but no messages are printed to the command window.
Most important thing I guess is that it didn't hang.
Forgot to add: That's on Windows 2000 Pro SP2.
bye Fabi