The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Sergiu FUNIERU on February 25, 2010, 11:37:43 PM

Title: Console program going GUI
Post by: Sergiu FUNIERU on February 25, 2010, 11:37:43 PM
The program in attachment was linked with:
WLink system nt file index.obj
instead of
WLink system win32 file index.obj

The executable works, starts as console, then displays a message box. I thought that console programs are confined to console. I expected an error or a warning, like when I try to run a Windows program under DOS.

Why does the program display the message box, instead of giving an error / warning?
Title: Re: Console program going GUI
Post by: hutch-- on February 26, 2010, 12:08:29 AM
Console applications written in 32 bit code are still portable executable files, the differ only in the subsystem used.
Title: Re: Console program going GUI
Post by: clive on February 26, 2010, 12:12:45 AM
Console applications can do anything that the Win32 API permits. This includes generating message boxs, windows, menus, etc.

-Clive
Title: Re: Console program going GUI
Post by: japheth on February 26, 2010, 12:57:48 PM
Quote from: hutch-- on February 26, 2010, 12:08:29 AM
Console applications written in 32 bit code are still portable executable files, the differ only in the subsystem used.

This is partially wrong. Both console and GUI application "use" the Win32 subsystem - other subsystems were OS/2 and Posix, but AFAIK those are no longer supported.

The difference between console and GUI is that the first ones have got a console window "pre-allocated" when they are launched, while the latter ones haven't.