Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6581127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:06:48+00:00 2026-05-25T16:06:48+00:00

Delphi Xe, Win7 I need the following function: Function isPcInDomain:bool; The domain name does

  • 0

Delphi Xe, Win7

I need the following function:

Function isPcInDomain:bool;

The domain name does not interest me, msdn LsaQueryInformationPolicy too (Or give realisation on Delphi). I would like to have a function that does no need to query the network.
Also it must still work if the local name of the computer contains a .

Tried to define a domain name, but on the personal computer which not in the domain – as a domain name gives out a name of Local Working group 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:06:48+00:00Added an answer on May 25, 2026 at 4:06 pm

    You can use NetGetJoinInformation:

    program test;
    
    {$APPTYPE CONSOLE}
    {$MINENUMSIZE 4}
    
    uses
      Windows, SysUtils;
    
    const
      netapi = 'netapi32.dll';
    
    type
      TNetSetupJoinStatus = (NetSetupUnknownStatus, NetSetupUnjoined, NetSetupWorkgroupName, NetSetupDomainName);
    
    function NetApiBufferFree(Buffer: Pointer): DWORD; stdcall; external netapi;
    function NetGetJoinInformation(lpServer: PWideChar; out lpNameBuffer: PWideChar;
      out BufferType: TNetSetupJoinStatus): Cardinal; stdcall; external netapi;
    
    procedure NetApiCheck(RetValue: Cardinal);
    begin
      if RetValue <> ERROR_SUCCESS then
        RaiseLastOSError(RetValue);
    end;
    
    function GetJoinInfo(out JoinStatus: TNetSetupJoinStatus): WideString;
    var
      P: PWideChar;
    begin
      NetApiCheck(NetGetJoinInformation(nil, P, JoinStatus));
      Result := P;
      NetApiBufferFree(P);
    end;
    
    procedure Main;
    const
      JoinStatusStrings: array[TNetSetupJoinStatus] of string = ('Unknown', 'Unjoined', 'Workgroup', 'Domain');
    var
      Info: TNetSetupJoinStatus;
      S: WideString;
    begin
      S := GetJoinInfo(Info);
      Writeln(Format('%s %s', [JoinStatusStrings[Info], S]));
    end;
    
    begin
      try
        Main;
      except
        on E: Exception do
        begin
          ExitCode := 1;
          Writeln(Format('[%s] %s', [E.ClassName, E.Message]));
        end;
      end;
    end.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Tpanel does not show the top and left border under Delphi XE/Win 7. Why?
Delphi does not yet support building 64-bit applications. What common tools are there for
Delphi strings use single quotes, for example ' a valid string '. How does
Under Windows Vista and Win7 there is a problem with applications created by Delphi
Delphi 2010, Win32 VCL. I need to create a main menu for my application
We wrote a Delphi program that send some informations with CDO. In my Win7
I have a TAPI Application (Delphi 2007) working on 32bits OSs (XP, Vista, Win7).
Does anybody know why FileAge is not working with c:\pagefile.sys? It returns -1. Update:
I search for a solution. We have Delphi 6 Prof on Win7/X64. When I
Delphi 2007 on windows 7 just does nothing on the saveDialog.Execute call. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.