To download NI software, including the products shown below, visit ni.com/downloads.
Overview
Call Windows API by using LabVIEW call library function node
Description
This example program demonstrates how we can use LabVIEW and the call library function node to call into the Windows API. In specific, we are using the advapi32.dll and the function GetUserNameA to retrieve the currently logged in user name.
Requirements
Software
LabVIEW 2013 (or compatible)
Steps to Implement or Execute Code
Additional Information or Reference
Note that the string here is simply initialized to a static length. If the user name is longer, simply make the string constant larger. The maximum user name length for Windows is 256 characters.
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.