To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This code demonstrates a “one button dialog” that closes automatically after a certain time.
Description
This code calls a generic "one button dialog" VI that will run in parallel with a "check elapsed time" loop. If the user press the OK button on the dialog box, this will exit the dialog box as usual. However, if the user does not press the OK button on the dialog, the "check elapsed time" loop will call a win32 DLL to programmatically press the Enter key on the keyboard. This will exit the dialog box, as long as the dialog box is the active window.
Note: This VI uses a win32 system DLL (user32.dll) in order to programmatically press the "Enter (Return)" key.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Block Diagram
**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.