[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Windows NT dont shut down

Posted on 2000-04-09
11
Medium Priority
?
203 Views
Last Modified: 2010-04-04
Following Problem:
1. New Application.
2. Use a NMPOP3 Component (Delphi Prof. or Delphi Client Server)
3. My Source Code

Prozedur "WMSysCommand"
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Psock, NMpop3;

type
TForm1 = class(TForm)
NMPOP31: TNMPOP3;
private
Procedure WMSysCommand(var Message: TWMSysCommand); message WM_SysCommand;
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.WMSysCommand(var Message: TWMSysCommand);
begin
inherited;
end;

end.

Coded in D4 and D5.
Windows NT with SP5 dont shutdown.
Why?
What can i do that Windows NT shuts down?
There are no Problems with Win 9x
0
Comment
Question by:Albion
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 2
11 Comments
 
LVL 9

Expert Comment

by:ITugay
ID: 2697541
I don't see any code in your sample to shutting down OS. I miss something?
----
Igor.
0
 

Author Comment

by:Albion
ID: 2697626
i dont want to shutdown NT by my programm.
if my application runs and i want to shutdown NT manuel, that dosent work.
i dont want sghut down NT with my Application.
0
 
LVL 9

Expert Comment

by:ITugay
ID: 2697657
I can't understand. Do you need to close your application if NT is about shutting down?

(Tu voulez fermer le programme si NT finit le travail?)
(Du willst das eigene Programm zumachen falls NT die Arbeit beendet?)

------
Igor.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:Albion
ID: 2697662
fein deutsch ...
folgendes ...
sobald du in delphi die elemente benutzt, NMPOP3 Komponente und die Windowsmessages abfängst (ich leite sie einfach weitermit inherited, nur als beispiel)

fährt NT nicht mehr runter wenn du NT einfach ganz normal beenden willst.
d.h. meine application verhindert den shutdown von NT.

erstelle diese Application mal bei dir unter NT ...
starte die EXE-datei und versuche dann NT zu beenden.
NT bricht den shutdown einfach ab...

ich weis nur nicht wieso..
in meiner eigentlichen application fange ich dort das minimize ab ...

ich weiß einfach nicht warum NT den shutdown abbricht

albion
0
 
LVL 9

Expert Comment

by:ITugay
ID: 2697675
Jetzt habe ich verstanden. Jetzt werde ich das Experiment machen. Einen Moment....
0
 
LVL 17

Expert Comment

by:inthe
ID: 2697725
hello,
if windows wil not shutdown then i sugest to handle WMQueryEndSession to listen when windows wants to close and when windows wants to shutdown it will return a "ok then close" to windows

Regards Barry


type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
   procedure WMQueryEndSession(var Msg: TWMQueryEndSession) ; message WM_QUERYENDSESSION ;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  ok_to_close : boolean;

implementation

{$R *.DFM}

procedure TForm1.WMQueryEndSession(var Msg: TWMQueryEndSession);
const
  CAN_SHUTDOWN = 0 ;
  DONT_SHUTDOWN = 1 ;
begin
  inherited ;
  if ok_to_close then {ok_to_close is the global boolean}
  Msg.Result := CAN_SHUTDOWN
  else {if ok_to_close has been set to false then we would get here}
    Msg.Result := DONT_SHUTDOWN ;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
ok_to_close := true;
end;
0
 
LVL 9

Accepted Solution

by:
ITugay earned 600 total points
ID: 2697745
Man muß nicht NMPoP3.Disconnect benutzen falls du die Verbindung zuerst nicht erledigt hast. Falls du die Version NetMasters 5.3 jenes TForm1.onCloseQuery benutzst

Procedure TForm1. FormCloseQuery (Sender: Tobject; var CanClose: Boolean);
begin
   NMPoP31. Abort;
end;

Hi Barry,
there are bug in TNMPop3. I guess that WMQueryEndSession will never called under NT in this case. I tryed it before.

-----
Igor.

0
 
LVL 17

Expert Comment

by:inthe
ID: 2697783
yep most all netmasters comps arent so good better to use winshoes or f.piettes i reckon ;-)
0
 
LVL 9

Expert Comment

by:ITugay
ID: 2697988
Barry,
agree;)
0
 

Author Comment

by:Albion
ID: 2698162
War zwar nicht NMPOP.Abort, sonder NMPOP3.Free, aber letztendlich wars das ...

Die Connection hab ich zwar vorher schon gekillt, rechte aber wohl nicht ...

besten Dank!!!

cu & hus
Albion
0
 
LVL 9

Expert Comment

by:ITugay
ID: 2699496
Ist froh war zu helfen.
----
Igor.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question