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

setconsolemode usage

cecio
Novice
1,586 Views
Hi,
i try to use "setconsolemode" to disable ctrl-c usage during elaboration process in a console application.

i can't retrive information or same example of using it unfer CVF.
MSDN is not so clear for me about how to set ENABLE_processed_input (or other property) to "disable".

have you some short examples about it.

thanks
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
1,586 Views

I haven't used SetConsoleMode, but, having skimmed through documentation, I think it should be

hConsole = GetStdHandle(STD_INPUT_HANDLE)
bSt= GetConsoleMode(hConsole, LOC(iMode))
iMode = IAND(iMode, NOT(ENABLE_PROCESSED_INPUT))
bSt = SetConsoleMode(hConsole, iMode)

Also, take a look at SetConsoleCtrlHandler.

Jugoslav
0 Kudos
cecio
Novice
1,586 Views

Thanks Jugoslav,

it works.

cecio

0 Kudos
Reply