11-10-2009 02:15 PM
Instead of create a new window, you can simply use your front panel.
To find the window handle, download Windows API Function Utilities (32-bit) for LabVIEW from NI website.
George Zou
http://webspace.webring.com/people/og/gtoolbox/
11-10-2009 05:38 PM
11-10-2009 10:39 PM
The video stream most likely will be displayed on the top-left corner of the window specified by hWnd, or a child window.
That's the choice of the Sensoray application. Same for fill the window.
11-11-2009 08:01 AM
Wow this is a really old thread of mine
I was actually able to figure this out, so here it goes:
You can use the current front panel window, or create another by placing a subVI in your application which shows its front panel and remains open for as long as you want to show the video. You need to know the name of this window (what shows up in the titlebar) to get the window handle. (This can also be changed by using VI Properties)
Next, to get the window handle you can use one of the VI's supplied from NI, or just use the User32.dll called "FindWindowA", which returns the handle based on window name. Now, from the sensoray DLL, use the function "SN_SetBoardWindow" (its parameters are defined in the 2250/51 documentation). One of these parameters is "bsize", which defines the size of the video which will be displayed in the window. There are 2 options, 720x480 (option 0) or 360x240 (option 1). What I did was resize the video window to fit whichever resolution size the user had chosen, and displayed the video in that window using that resolution.
All thats left after that is to make the "SN_StartStream" call from the sensoray dll and the video should appear in the window! (Assuming that the device was initialized properly prior to doing any of this).
Hopefully this helps, let me know how it goes!
Eric
11-11-2009 09:28 AM
Here is what I am doing:
First: I use the Open Board API, then I use the Set Board Window (feeding it the Hwnd value from Get Window Refnum.vi modified to send out Hwnd instead of windows reference), then use the Start Stream API. When I do this the Start Stream API returns a value of -2147220985. And nothing happens. I have attached the little test program. Hopefully the issue is just that I haven't initialized something correctly.
Also, one other note, the API I have for the Set Board Window defines the in's and out's to be Board (interger), Reserved (Bool), and Hwnd (hwnd). Thanks.
11-11-2009 01:06 PM
I cant open your VI because i'm using 8.5, but the arguments I am passing SN_SetBoardWindow are HWND (U32), bsize (U8), and board (I32). I then call SN_StartStream which only takes board (I32) as an argument. I am not sure what the error you are recieving from SN_StartStream means, but my guess is that you are not correctly setting the board window. If you save your VI in LabView 8.5 or lower, I will check out what your doing.
Eric
11-11-2009 02:14 PM