Software Archive
Read-only legacy content
17060 Discusiones

Win application without winconsole

Intel_C_Intel
Empleados
1.319 Vistas
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 Respuestas
Jugoslav_Dujic
Colaborador Valioso II
1.319 Vistas
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
david_jones
Principiante
1.319 Vistas
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.
Responder