From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
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
**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.
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).
This does not work in Win10. When calling the function when another application is at the front the LabVIEW window simply starts flashing in the taskbar. Any tips?
This approach doesn't currently work for me when incorporating into an executable. Are there are any other files I need to include in my project for this to work in an executable??
Posted a new version here. (images and\or attachments are not allowed here?).
That handle needs to be a pointer sized integer.