IDEA: ShutdownHook does not work in windows on Ctrl-F2

In windows when i stop Intellij debugging by Ctrl-F2, registered shutdown hook does not works:
Runtime.getRuntime().addShutdownHook(object : Thread() {
override fun run() {“program stopped”) }

In windows console when stopping by Ctrl-C hook works good

In linux everything works good in both cases.

Any help?

Please ask IntelliJ IDEA related questions in the IntelliJ IDEA forum. Thanks.

ok, thank you and sorry