Example Code

Embed VI or Exe on LabVIEW Front Panel

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Description

This example demonstrates how to embed a VI or an application on another VI front panel. This example uses Windows API (user32.dll) to get the handle of the VI or application and embed it inside the running VI front panel. The functions being used are FindWindowA function and SetParent function.

LV 2018 snippet.png

 

 

 

 

 

How to Use

 

  1. Type the title name of the desired windows handle of the VI or application into the string control.
  2. Run the VI.
  3. The VI or application will embedded onto the front panel and can be move freely within the front panel.

LabVIEWVI.png Application.png

Additional Information

The example code would work for application that has only a single window handle name and not for application that may have multiple tab names as its window handle. For example, Notepad in Windows 11 would not be able to embed onto the front panel using this code since it has multiple tab names.

Notepad Issue.png

Related Links

Call Library Function Node - LabVIEW Help

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors