Вниз
Скачать: 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.45 MB
Время: 0.018 c
14-89477
Дремучий
2003-10-06 15:46
2003.10.27
Попрошу покритиковать(самописный чат)....


14-89507
Gorlum
2003-10-09 11:03
2003.10.27
Выжигание изображения на диске


3-89189
GreatMaster
2003-10-06 11:19
2003.10.27
---|Ветка была без названия|---


14-89541
Term
2003-10-08 11:26
2003.10.27
Помогите прицениться


3-89169
AndCot
2003-10-03 15:23
2003.10.27
Два TTable один dbf




   Наверх