visual c++ - C++ Prevent the console window from closing when red X is clicked -


i'm developing simple c++ console application without classes & objects.
there method or function prevent console closing when red x button clicked ?
i'm using visual studio c++ express 2010 : simple console application containes main.cpp file. thank answering question :) !!

you can use setconsolectrlhandler control console-window. need write callback handle events (such ctrl_close_event). may use getconsolewindow function window-handle, , handle window messages. have done controlling window former method, , not sure handling specific window message (via window-handle).

refer console functions.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -