Example Programs

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically Move Any Window to the Front

Overview

This VI will programmatically move a window to the front whether its a LabVIEW window or not.

 

 

Description

This VI will programmatically move a window to the front whether its a LabVIEW window or not.  There are two Windows APIs that are used to achieve this.  The first one (FindWindow) acquires the handle of the window that you want to bring to the front.The name of the window is passed into the lpWindowName terminal and NULL is passed into the lpClassName terminal.  The second windows API is SetForegroundWindow. This moves the window corresponding to the passed handle to the front.

 

 

Requirements

LabVIEW 2012 (or compatible)

 

 

Steps to Implement or Execute Code

1. Open the VI "Bring Window Forward_LV2012_NI Verified"

2. Choose the window name you want to bring to front
3. Run the VI
4. Stop Execution

 

 

Additional Information or References

 

BD.PNG

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Regards,

Sara Lewandroski
Applications Engineer | National Instruments
http://www.ni.com/support
Comments
Member michelesc
Member

Hi,

this approach seems not to work if my VI execute a SysExec and wants to keep the external application to the background.

Root cause seems you cannot move a window from a background application (that is, after LV executes Sysexec).