02-16-2012 02:25 PM
Is it possible to get a valid Windows handle of a VI that is running in a SubPanel? Windows Handle (hWnd) of a SubPanel VI. A call to FindWindowA returns 0 when a VI is running in a SubPanel.
02-16-2012 04:27 PM
What is it that you are trying to accomplish? Why do you need the Windows Handle?
Mike...
02-17-2012 07:35 AM
I am trying to display a video stream from a Sensoray 2250 framegrabber. The video stream function of the Sensoray SDK uses an hWnd to select a window for displaying the video stream. I would like the video stream to be part of, but not my entire GUI. I created a VI that calls the Sensoray SDK which works as an independent VI, but when placed in a subpanel it fails. I probed the hWnd of my VI in the subpanel and it returns "0".
Any secret way to get at the hWnd of a vision control?
02-17-2012 09:45 AM
02-17-2012 03:17 PM - edited 02-17-2012 03:19 PM
It turns out that the Sensoray frame grabber works with IMAQdx. This solves all my problems trying to interface with the 3rd party dll drivers. Now if I could just get back the last couple of days of my life.
02-17-2012 03:26 PM
Hey, you learned something. It's all good...
Mike...
02-17-2012 09:52 PM
Actually, LV front panel is a Windows window. It has a titlebar, a frame and a client area. And has window handle.
A subpanel might not be a window. At least, not top level window, so FindWindow won't work.
02-18-2012 03:26 AM - edited 02-18-2012 03:29 AM
I guess I wasn't clear. Of course a LV front panel is a Windows window with a window handle. But logically it is more. It is a place where LV objects live.
This DLL he was using could only relate to a LV front panel as a generic window. It couldn't know or care about what else might be there. I couldn't understand or participate in the logical structure that exists on a LV front panel with controls and indicators.
That is what I meant.
Mike...
01-12-2015 04:30 AM
Hi everybody,
This is a quite old post but I would like to know if a solution has been found to this issue (getting a handle of the front panel of a subpanel VI).
I want to use an external library that needs a handle to display specific images/graphs.
It seems to be OK to get the handle of a "dialog based" VI but I would like to do this display in a subpanel VI...
Is there something like a "Get Child Window" or thing like that to get a vald handle?
Thanks for your help
Lionel
01-12-2015 08:32 AM
To answer the question, yes there are ways of getting a HWND of a LabVIEW front panel. The large majority of the time you don't really need this. Most people are set in their ways of window manipulation, and don't realize that VI server has many of those functions built in, which are cross-platform so they should be used when possible.
But on the off chance that you want to do something VI server doesn't allow you can get the HWND a couple ways. First you can use the FindWindowA function and pass VI Title.
But there is also a lesser known feature of LabVIEW that is only exposed when you have some debugging feature turned on, which allows you to get the HWND of a window. Here is a thread discussing it.
https://lavag.org/topic/13803-getting-the-window-handle-for-a-fp-with-no-title-bar/
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord