From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
Does anyone know if this is possible? I'd ike to make an application that is transparent and runs on top of a 3rd party application. I would plot data in my application over top of the other app.
Do-able or not? I've looked around and don't see a way of doing it.
Unfortunately there isn't a direct way of making a LabWindows/CVI panel trasparent, by using a predefined panel attribute.
However, here is a workaround to make your panel transparent, using Win32 API:
#include <windows.h> in your source code.
Get the window handle (HWND) of the panel, using the ATTR_SYSTEM_WINDOW_HANDLE panel attribute: HWND hwnd; GetPanelAttribute (panelHandle, ATTR_SYSTEM_WINDOW_HANDLE, &hwnd);
Configure windows layering: SetWindowLong ((HWND)hwnd, GWL_EXSTYLE, GetWindowLong((HWND)hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
Enable window transparency (see MSDN😞 // Set the alpha for transparency: 0 is transparent and 255 is opaque. double transparency = 50; // Set transparency to 50%. double alpha = transparency * (255.0 / 100); SetLayeredWindowAttributes ((HWND)hwnd, 0, alpha, LWA_ALPHA);
Just had to change HWND hwnd; to int HWND; in order to get the right variable type for GetPanelAttribute(), which works OK since it's cast to HWND below that.