Software Archive
Read-only legacy content
17061 Discussions

Win application without winconsole

Intel_C_Intel
Employee
428 Views
I am the first time user of this forum.

I would like to create a Fortran Console Application that runs on Win 98 without a dos window appearing. How can I do that?
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
428 Views
The point of using console applications is to have a console. Technically, you could hide it but the code would be a little complicated (I could post it but right now I'm in quite a hurry).

The simpler method would be to recompile the application as Windows application,
replacing PROGRAM with:

 
INTEGER(4) FUNCTION WinMain(hInst, hPrevInst, szCmdLine, nCmdShow) 
!DEC$ATTRIBUTES STDCALL, ALIAS:"_WinMain@16" :: WinMain 
!DEC$ATTRIBUTES REFERENCE:: szCmdLine 
INTEGER:: hInst, hPrevInst, nCmdShow 
CHARACTER(*):: szCmdLine 
 


Note, however, that in the latter case any attempt to PRINT * or WRITE(*) (which are useless anyway if the widnow is hidden) would cause a crash. If your program has command-line arguments, you couldn't use GETARG, but parse szCmdLine yourself.

Jugoslav
0 Kudos
david_jones
Beginner
428 Views
You may find it enough simply to change the proprties associated with your console application. For example, set the properties of a shortcut to your .exe file to be "start minimised" or whatever phrase is used in your OS.
0 Kudos
Reply