It depends on the Win32 program. Clearly, GUI programs cannot run for obvious reasons. Console applications on the other hand may be able to run.
In 1998 Chris Jones wrote a DOS program called WinEM (previously DOSCon) which attempts to emulate the Win32 API so that Windows console programs can be run under DOS. According to the manual, he had apparently intended to support GUI programs and even Direct-X games but had, as of version 1.00, implemented only basic DX and windowing functions (ie, only enough for “'hello, world'-in-a-window”).
I cannot find any newer versions, so I suspect that it turned out to be more difficult than he hoped and so he abandoned the project. Also, because the program was written during the time of Windows 98, it may (probably?) does not support later versions of Windows (2000+).
+1 DOS in Windows 98 is 16 bit. The Windows GUI is a 32 bit wrapper on top of that. For Windows 3.1, there was some Win32 library hacks, but that was never extended to DOS (AFAIK). – Trav – 2011-12-14T20:46:58.477
Wow, +1 for HX DOS Extender, that's a sweet (and open source!) program I never heard of before. – Breakthrough – 2011-12-14T22:54:43.790
Tried HX and it ran DigitalMarsC perfectly, although I haven't tried to compile anything yet. I also tried running a .NET executable with it and it told me that there were DLLs missing, so that could take some hacking to make work. Thanks for your answer! IMPORTANT NOTE: The HX-RT zip has a virus in it, so keep that in mind, all ye who read this post! – StackUnderflow – 2011-12-15T18:10:36.330
@StackUnderflow: Thanks for letting us know. I updated my post and emailed the program's author. – haimg – 2011-12-15T18:31:42.007
2
@Trav: The Windows 9x GUI was not a wrapper anymore; it only uses DOS as a bootloader, and to handle 16-bit drivers.
– user1686 – 2011-12-15T20:06:19.287@grawity Your included link is a great post! I wish I'd have read something like that when I was still using Windows 9x! – Trav – 2011-12-16T12:48:08.683