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

1-Dialog caption. 2-Minimizing console window

cacciatore
Beginner
522 Views
Hi

I have two doubts:

1-Depending on the value of a variable I want to change the caption of a QWIN dialog ( before calling DLGMODAL for sure).
DLGSET(DLG,IDD_DIALOGX,DLG_TITLE,..) did not work.
How to do it?

2- In an old console program I created a progress bar (thanks to Jugoslav's ThreadDlg ), and some messagebox (instead of using write(6,*)).
I want to minimize the black console window. How to do it?
Rebuilding as a qwin project, the framewindow could be miinimized, but I would like to know if and how it can be done in a console app.
I know in a pure windows project the same could be done, but not by me,at least in near future.

Thanks

Geraldo
0 Kudos
5 Replies
Jugoslav_Dujic
Valued Contributor II
522 Views
1) There's separate DlgSetTitle routine. I think the way you wrote it is actually far more consistent with other DFLOGM interfaces, but it doesn't work :-(.

2) Don't be so affraid of Windows applications. If you replace PROGRAM...END PROGRAM statements with INTEGER FUNCTION WinMain(blah, blah... END FUNCTION and recompile as Fortran Windows Application, any existing dialog-based or console application will work (but won't produce console window or output to it). You just have to be careful not to perform a WRITE(*, -- it will cause a crash; you have to either comment it out or redirect to a file. It doesn't have to have any RegisterClass, CreateWindow or GetMessage thingo -- plain number crunching or DlgModal works (just don't fall into trap of letting AppWizard generate the code for you).

Minimizing/hiding console window is a bigger pain than replacing PROGRAM with WinMain. You'd have to find the console window by its title using FindWindow API, then ShowWindow(SW_MINIMIZE or SW_HIDE) on it.

Jugoslav
0 Kudos
cacciatore
Beginner
522 Views
Jugoslav

Norman Lawrence's Guide to Win App helped me a lot in Qwin app, but full Win App seemed toooo complicated. Will try the bare win project you suggested.

Thanks for the tips.
0 Kudos
cacciatore
Beginner
522 Views
Everything worked ok.
The blah.. blah I toke from a Steve Lionel reply.
As I could not find how to change the project type from Console to Windows Application I had to create a new project with another name. Is it possible to change the project type so the .exe keeps the same name?
Thanks
Geraldo
0 Kudos
Jugoslav_Dujic
Valued Contributor II
522 Views
I think it's enough to change /subsystem:console to /subsystem:windows on Project/Settings/Link tab (you have to retype it, there's no dialog control for it).

Jugoslav
0 Kudos
cacciatore
Beginner
522 Views
The change you suggested worked ok.
Thanks. You are the real on line help for CVF.

Geraldo
0 Kudos
Reply