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

setconsolemode usage

cecio
新手
2,261 檢視
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 積分
2 回應
Jugoslav_Dujic
傑出貢獻者 II
2,261 檢視

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
cecio
新手
2,261 檢視

Thanks Jugoslav,

it works.

cecio

回覆