Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2007 Mar : ENDSESSION_LOGOFF in case statement

www.cryer.info
Managed Newsgroup Archive

ENDSESSION_LOGOFF in case statement

Subject:ENDSESSION_LOGOFF in case statement
Posted by:"Michael Fritz" (spam_athome@yahoo.de)
Date:Thu, 29 Mar 2007 11:27:42

Hi,

using TurboD I've got a strange warning from the compiler:

procedure TMyAppEvents.HookWndProc(var LocalMessage: TMessage);
begin
    with LocalMessage do
    begin
      case Msg of
        WM_ENDSESSION :
          begin
            case LParam of
              ENDSESSION_CLOSEAPP : HandleSessionCloseApp;
              ENDSESSION_LOGOFF   : HandleSessionLogoff;
            else
              HandleEndSessionBroadCast(LocalMessage);
            end;
          end;
[..]

ENDSESSION_LOGOFF is defined in Windows.pas as follows:

  ENDSESSION_LOGOFF        = DWORD($80000000);

The warning I get from the compiler is W1012 and W1018 which means first
the const value violates the lower boundaries:
(German: W1012 Konstantenausdruck verletzt untere Grenzen)

The second warning reads in German: W1018 Case-Label außerhalb des Bereichs
des Case-Ausdrucks.

What did I made wrong here? I just used pre-defined constants and
structures.
--
cu,
Michael

Replies:

www.cryer.info
Managed Newsgroup Archive