otya128 / winevdm

16-bit Windows (Windows 1.x, 2.x, 3.0, 3.1, etc.) on 64-bit Windows
GNU General Public License v2.0
2.65k stars 152 forks source link

FindWindow, PROGMAN and DDE #201

Closed cracyc closed 5 years ago

cracyc commented 5 years ago

The Civ2 installer uses FindWindow to locate a PROGMAN class window and sends DDE messages to it directly to create the program group. This doesn't work because the progman atom is replaced with progman16 which explorer doesn't recognize. Maybe winevdm's ddemlevent hwnd should be substituted in FindWindow.

leecher1337 commented 3 years ago

I found a very strange DDE behaviour regarding progman, maybe you have an idea: WOW32 sends a WM_DDE_INITIATE to HWND_BROADCAST and asks for Progman. Explorer.exe has a window of class DDEMLMom which replies to the Broadcast message with WM_DDE_ACK, creates a new dde Message window and sends its handle via this message. So far, so good, 16bit app now knows DDE window of progman. So next, application sends a WM_DDE_EXECUTE to mentioned handle via SendMessage(). I verified with Spy++ that the Window handle is correct. SendMessage doesn't return an error, however, I verified with a debugger attached to explorer.exe that the target Window procedure of the message handling window (I also checked that with Spy++) never gets called, so DDE message just gets swallowed, no WM_DDE_ACK, sending applications hangs. Did you also experience this strange behaviour or do you have a hint on how to debug that?

cracyc commented 3 years ago

Yep, https://github.com/otya128/winevdm/pull/252

leecher1337 commented 3 years ago

Hehe, found out a few hours ago, too: https://github.com/leecher1337/ntvdmx64/commit/1ad4b98dc10d32fc8d834a5be603110034f61859 Thanks anyway :)