When you write a program in LabView, at some point it becomes too much to fit in one screen. LabView's “good tone rules” suggest that in such cases it is necessary to split one vi file into several subvi files. Over time, these subvi becomes very much. However, the guys from NI somehow did not take care of the easy navigation.
Not only does LabView move all its windows to the top of the Alt-Tab list (no one else does this:
en.wikipedia.org/wiki/Alt-Tab ), but also, despite the extensive use of the ability to override icons for vi files, Alt-Tab list instead of them - slim rows of LabView logos:

')
Some of this behavior pushes to buy a second monitor. For them, the problem is largely solved. Still partially helps the Windows Aero interface with its thumbnails in the Alt-Tab menu. But the solution that seems to be lying on the surface is (a) making the switch is the same as in all other applications, and (b) displaying vi icons in the list is not possible with standard tools.
Judging by the fact that it began almost from the very first version, and the corresponding “improvement idea” has been
gathering dust on the “forum for the exchange of ideas” since 2010,
forums.ni.com/t5/LabVIEW-Idea-Exchange/Make-Alt -Tab-behavior-consistent-with-other-applications / idi-p / 1162219 , asking National Instruments is useless. However, you can still do something.
Part 1. Quit Labview with one click.
First, I wrote this python
script with which you can switch between, for example, the browser and the current LV window in one click, say, Alt-`:
import ctypes EnumWindows = ctypes.windll.user32.EnumWindows EnumWindowsProc = ctypes.WINFUNCTYPE(ctypes.c_bool, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int)) GetWindowText = ctypes.windll.user32.GetWindowTextW GetWindowTextLength = ctypes.windll.user32.GetWindowTextLengthW IsWindowVisible = ctypes.windll.user32.IsWindowVisible GetClassName = ctypes.windll.user32.GetClassNameW SwitchToThisWindow = ctypes.windll.user32.SwitchToThisWindow we_are_in_labview = None def get_title(hwnd): length = GetWindowTextLength(hwnd) buff = ctypes.create_unicode_buffer(length + 1) GetWindowText(hwnd, buff, length + 1) return buff.value def get_cls(hwnd): buff = ctypes.create_unicode_buffer(100) GetClassName(hwnd, buff, 99) return buff.value def foreach_window(hwnd, lParam): global we_are_in_labview title, cls = get_title(hwnd), get_cls(hwnd) if IsWindowVisible(hwnd): title, cls = get_title(hwnd), get_cls(hwnd) if (title, cls) in (('Start', 'Button'), ('', 'Shell_TrayWnd')) or \ cls == 'TeamViewer_TitleBarButtonClass': return True if we_are_in_labview is None: we_are_in_labview = cls.startswith('LV') else: if we_are_in_labview and cls.startswith('LV'): return True SwitchToThisWindow(hwnd, True) return False return True EnumWindows(EnumWindowsProc(foreach_window), 0)
In general, I wrote in parallel on c and on python, here I give the version in python because this way the code is a bit more readable and can be run without visual studio (only installed python of any version: 2.x or 3.x is required).
Hanging up the script on the shortcut key is also possible in python, but with the help of autohotkey, it is easier to do:
#IfWinNotActive ahk_class PuTTY !`:: Run, C:\alttab\switch.py,,Hide
(here the binding is disabled in a single putty program)
Part 2. Switch to vi by clicking on its icon
Secondly, I modified the appropriate quickqrop
Show Open VIs plugin to give it a divine look and added keyboard navigation.


Compared to the existing Show Open VIs navigation tools:
- Better Project Explorer that shows only open files, but not all files in the project, plus does not take up too much space on the taskbar and in the Alt-Tab list (Fig. Left);
- Better than the built-in LV window manager (Ctrl-Alt-W) by the presence of icons (Fig. Right);
- Better than the system Alt-Tab in that these are exactly vi icons and not a multiple NI logo.
By pressing the right mouse button, you can choose whether to switch to the Front Panel or Block Diagram.
In the original, this plugin looked very raw and sloppy. Everything fit each other, and when you reduce the window size to a size comparable to the usual alt-tab window, it stopped working altogether.
I put the plugin code on a
githaba . Checked in LV 2011 and 2014, x32 and x64. To install, you need to copy several files to the "correct" subdirectory of My Documents, restarting Labview is not required. Depends on the OpenG File Library. Details in the readme.
Control from the keyboard did this: Ctrl-Space Ctrl-4 to launch (so that there were no conflicts with other plugins), [Ctrl-] Tab or the right arrow the next item, [Ctrl-] Shift-Tab or the left arrow - the previous one Enter or Space - switch, Esc - exit.
In order not to press this extra Ctrl-Space (enter the quickdrop menu), you can use this script on autohotkey to start it, for example, by pressing Ctrl-`:
#IfWinActive ahk_class LVDChild ^`b:: Send ^{Space} WinWait Quick Drop Send ^4
The time gap between the appearance of the quickdrop window and its closing after receiving the shortcut key was about 0.12 seconds. In principle, this is not bad, but the eye manages to see the “extra” window. Those who, like me, quickdrop except for launching plug-ins do not use, may find this undocumented option in labview.ini useful:
QuickDropTransparency=100
It makes the QuickDrop window invisible (the parameter means 100%) with all the functionality preserved.
I didn’t think up how to combine these two improvements (displaying vi icons and the usual alt-tab behavior) - all LabView windows are in the same window group and programmatically move within the z-order sequence in the same way as through the GUI: only as one unit, that is, information about what kind of switching it was from — inside LabView or outside LabView — is lost. You can memorize the story when you press the alt-tab, but this method is not universal, because it does not catch switching using the mouse.
Eventually
By installing the described script and plugin, we get the following features: by pressing Alt-`it is very convenient to switch between, for example, the browser and some specific window in LabView, and by pressing Ctrl-` you can see the icons of open vi files and switch between them or mouse either from the keyboard.