Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29342 Discussions

Console application with no screen output

reinaldogarcia
Beginner
798 Views
I have an console application that outputs only to files and I would like to suppress the windows that automaticaly the console application creates.

Is there a way to do this?

Thanks,

Reinaldo
0 Kudos
2 Replies
Steven_L_Intel1
Employee
798 Views
Not as a console application. What you want to do is make it a "Windowing Application" with a WinMain entry point. You can skip all of the stuff about window creation and class registration - all you need is the WinMain function with the right declaration (the project wizard will create one for you) and the rest can be discarded. When this program is run, there will be nothing on the screen that you didn't put there.
0 Kudos
Steven_L_Intel1
Employee
798 Views
Here's what a minimal source would look like:

[plain]integer(DWORD) function WinMain( hInstance, hPrevInstance, lpszCmdLine, nCmdShow )
!DEC$ ATTRIBUTES STDCALL, DECORATE, ALIAS : 'WinMain' :: WinMain

use ifwinty

implicit none
    
integer(HANDLE) hInstance
integer(HANDLE) hPrevInstance
integer(LPVOID) lpszCmdLine
integer(DWORD) nCmdShow

! Your code goes here

end function WinMain[/plain]

0 Kudos
Reply