[comp.windows.ms] Staring Windows app from DOS box.

schansen@amc-gw.amc.com (Scott Hansen) (03/22/91)

In article <1991Mar15.084619.16265@ecn.nl> rijnsburger@ecn.UUCP
(Wim Rijnsburger) writes:

>>I should like to know why Windows applications cannot be launched from
>>a DOS window. I know that Windows applications call a special function
>>if Windows is not present. But maybe there is a way to catch the situation
>>that Windows is up and running, while the DOS window is active?

From: alan@ukpoit.co.uk (Alan Barclay)
>WINVER does this. Don't know how though.


WINVER accomplishes it by using a custom STUB.EXE when the utility was
linked (I would assume).  The stub is what displays the error message
"This program requires Microsoft Windows", amoung other things.  

If you look at WINVER with some kind of hex editor, you will see the
message "Windows Version 3.00" is hardcoded in the executable, instead
of the standard error message.  So, it is not as smart is you think it
is, it just appears that way.

To accomplish what you want, the stub would have to:  Check to see if
Windows is running, if it is, EXIT the current DOS box and post a
message to the Windows system queue to launch the application.  If Windows
is not running, it would have to start Windows and pass the application's
binary executable filename as a command line argument.

Well, thats why and a generic how, but I'll leave the specifics up to the
Senior Windows Hacks, I'm still in Junior mode...

-Scott
-- 
==============================================================================
Scott Hansen (schansen@amc.com)           Sysop...:  The Crystal Chip 
Applied Microsystems Corporation          BBS.....:  (206) 226-6550    
Redmond, Washington  98073                Voice...:  (206) 882-5322