Вниз
Скачать: CL | DM;

определение события завершение работы Windows   Найти похожие ветки 

← →
wolfic   (2003-08-12 17:49) [0]

Возникла следующая проблемка необходимо программно определять момент отключения/перезагрузки Windows сделать свои дела и продолжить отключение


← →
Anatoly Podgoretsky ©   (2003-08-12 17:56) [1]

wm_queryendsession


← →
wolfic   (2003-08-15 11:47) [2]

Дело в том что нужно узнать это раньше всех программ - просто система успевает выгрузить часть программ а среди них и программы для доступа к дискам и следоватльно облом к ним достучаться нельзя!!!!!


← →
Spawn ©   (2003-08-16 08:36) [3]

По идее сообщения рассылаются окнам в их Z-последовательности. Тогда, по идее, нужно, чтобы твое приложение было первым в этой последовательности. Смотри SetWindowPos.


← →
Vova 777   (2003-08-16 16:52) [4]

{When Windows is about to shut down, it sends
a WM_QueryEndSession to all open applications.
To detect (and prevent shutdown), we must
define a message handler to this message. Put
this definition on the private section of the
main form:}

procedure WMQueryEndSession
(var Msg : TWMQueryEndSession);
message WM_QueryEndSession;

{Also, to prevent Windows shutting down
put this method in the implementation
section of the unit:}

procedure TForm1.WMQueryEndSession
(var Msg : TWMQueryEndSession);
begin
if MessageDlg("Close Windows ?",
mtConfirmation,
[mbYes,mbNo], 0) = mrNo then
Msg.Result := 0
else
Msg.Result := 1;
end;

{To detect Windows Shutdown, we must trap the
WM_EndSession message.
Declare a message handling procedure
in your main Form"s Private section: }

Procedure WMEndSession
(var Msg : TWMEndSession);
message WM_ENDSESSION;

{Also, add the following procedure to the
implementation section of your Unit:}

procedure TForm1.WMEndSession
(var Msg : TWMEndSession);
begin
if Msg.EndSession = TRUE then
ShowMessage("Windows is shutting down " + #10#13
+ "at " + FormatDateTime("c", Now));
inherited;
end;



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.46 MB
Время: 0.018 c
3-89134
Inkotex
2003-09-28 15:52
2003.10.27
Blob поля в Delphi и IB


1-89214
vv40in
2003-10-15 12:53
2003.10.27
интерфейс c Cи


6-89419
Support1
2003-09-01 21:39
2003.10.27
Определение скорости Инета


4-89651
DANTIST
2003-08-20 19:43
2003.10.27
Работа из Delphi с DLL на C++


1-89265
Марат
2003-10-14 13:52
2003.10.27
Модальность форм




   Наверх