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
- This code will function by itself at either top level or as a subVI.
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.**
Cole R.
National Instruments
Software Engineer