Autor Beitrag
moddin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 75

WinXP Pro
Delphi 7 Enterprise ;-)
BeitragVerfasst: Do 01.06.06 17:49 
Ich verushce mich gerade an nem kleinen brennprogramm

und da soll natürlich wenn ich ne CD brenne windows nicht einfach heruntergefahren werden

Ich hab was bei ..MSn.. ShutdownBlockReason und konsorten gefunden hab aber keine ahnung wie man das
nach delphi bekommt
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 01.06.06 18:37 
Bitte gib mal die Links zu deinen Quellen kurz sowie ggf. kleine Source-Sample aus'm MSDN. Vielleicht lässt sich da was drehen. Deklarationen portieren sollte (sofern rein API) nicht all zu kompliziert werden.

Moderiert von user profile iconBenBE: Solltest Du die 3 Funktionen ShutdownBlockReasonCreate, ShutdownBlockReasonDestroy und ShutdownBlockReasonQuery meinen, so muss ich dich enttäuschen: Diese sind nur unter Windows LH\AstalaVista verfügbar. Solltest Du noch XP nutzen, musst Du Dir einen anderen Weg suchen dein Ziel zu erreichen.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.


Zuletzt bearbeitet von BenBE am Do 01.06.06 18:48, insgesamt 1-mal bearbeitet
Raffo
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 300



BeitragVerfasst: Do 01.06.06 18:47 
In Deiner HauptForm muss im "OnCloseQuery" folgender Code stehen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
if yesCanClose=false then
   begin
   canclose:=false;
   exit;
   end;
end;

Die Var "yesCanClose" muss im Hauptproggi definiert sein. Ich setze auf meine eigenen Button zum Schliessen der Anwendung also ein Ereignis:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.EndeClick(Sender: TObject);
begin
yesCanClose:=true;
close;
end;
So kann Dein Proggi also niemals über (X) geclosed werden, sondern nur noch über Deinen eigenen Button.
moddin Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 75

WinXP Pro
Delphi 7 Enterprise ;-)
BeitragVerfasst: Do 01.06.06 19:18 
thnx

also die links

msdn.microsoft.com/l...tdown.asp?frame=true
msdn.microsoft.com/l...lockreasoncreate.asp
msdn.microsoft.com/l...lockreasoncreate.asp

(wenn man einen von denen eingiebt kommt bereits links eine liste mit den sinnverwanten)