Good afternoon, colleagues!

How do I know the button was pressed or not on the system unit to turn off the computer.

Thank you with respect.

    1 answer 1

    Dig in the direction of WM_QUERYENDSESSION, maybe something you will find in Google. Here is a description of WinAPI shutdown. But, I think that a driver is needed here to get information from hardware, C # will hardly help you.

    • WM_QUERYENDSESSION is the result of the message sent from the application. I would have here a little bit earlier. Just there is such a situation, if the user goes into Lock mode, then when you press a button on the system unit, nothing happens. I would find out exactly what happens in this case and calculate the click of a button. The task is not simple, but where to dig is already confused. - itprodavets
    • Already not on one forum asked a question. No one has yet sent the right way to dig. Windows threads have nothing to give. - itprodavets