To download NI software, including the products shown below, visit ni.com/downloads.
Overview: This VI will find the handle of a specified window name and bring that specific window to the front of the screen.
Description: This VI will find the handle of a specified window name and bring that specific window to the front of the screen.
Requirements: LabVIEW 2012 (or compatible), User32.dll found in /Windows/System32/
Steps to Implement or Execute Code:
1. Launch some application (e.g. Calculator from Windows-Run)
2. Enter Window name in the corresponding control (i.e. Calculator)
2. Run this VI.
3. The Calc window will appear on the top of the display.
4. Write down the handle.
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.
This was not working for me if I shifted focus to another application. According to this KB, an application cannot force a window to the foreground while the user is working with another window. Check this out if you're having trouble: How do you make your application window frontmost? It contains an example of attaching the LabVIEW window to the process' thread. So apparently you can force a window to the foreground if you trick the window into the other application's process...?
NI has a pretty good collection of Windows API calls ( http://zone.ni.com/devzone/cda/epd/p/id/4935 ) for more advanced stuff, microsoft MSDN rules the world in windows
Yes - winapi is great. But not for 64 Bit windows...
Whats wrong with 64-bit?