Skocz do zawartości

poweroff i zapis konfigów


Recommended Posts

Napisano

Przy wyłączaniu kompa przyciskiem w obudowie lub na klawiaturze system się zamyka, jednak mój program jest killowany. Czy przy tym zdarzeniu (tj. wyłączeniu) jest wysyłany jakiś komunikat, dzięki któremu byłbym w stanie zamknąć program poprawnie, zapisując ustawienia do pliku?

Napisano

Kawałek z MSDNa:

The WM_QUERYENDSESSION message is sent when the user chooses to end the session or when an application calls the ExitWindows function. If any application returns zero, the session is not ended. The system stops sending WM_QUERYENDSESSION messages as soon as one application returns zero.

After processing this message, the system sends the WM_ENDSESSION message with the wParam parameter set to the results of the WM_QUERYENDSESSION message.

WM_QUERYENDSESSION
nSource = (UINT) wParam; // source of end-session request
fLogOff = lParam // logoff flag

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gość
Odpowiedz...

×   Wkleiłeś zawartość bez formatowania.   Usuń formatowanie

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Utwórz nowe...