Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Pascal
Expertise: Beginner
May 13, 1997



Building the Right Environment to Support AI, Machine Learning and Deep Learning

How to call a Win 32 API function that doesn't appear in Windows.pas

How can I call a Win 32 API function that doesn't appear in Windows.pas (EX: NetUserAdd)? I found it in the Delphi Help file, but cannot find it in Windows.pas.

I know it gets confusing, but the Windows API function calls, while primarily in Windows.PAS, are not all contained there. There are several other files such as Messages.PAS, ShlObj.PAS, ShellAPI.PAS, TLHELP32.PAS, etc. These comprise what is known as the WinAPI.

With respect to the function you found, that is specific to Windows NT, and only available through the NETAPI32.DLL, which is not interfaced with a PAS file. This means you have to write your own interface to it. At the very least you'll have to make your own external function declaration referring to this DLL. But it'll only work on NT.

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date