ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing API function with HWND

Hello,

I have a camera with a dll with a function to start the camera. The following is copied from the header file... 

#define TCAM_EVENT_EXPOSURE      0x0001    /* exposure time changed */
#define TCAM_EVENT_TEMPTINT      0x0002    /* white balance changed, Temp/Tint mode */
#define TCAM_EVENT_CHROME        0x0003    /* reversed, do not use it */
#define TCAM_EVENT_IMAGE         0x0004    /* live image arrived, use Tcam_PullImage to get this image */
#define TCAM_EVENT_STILLIMAGE    0x0005    /* snap (still) frame arrived, use Tcam_PullStillImage to get this frame */
#define TCAM_EVENT_WBGAIN        0x0006    /* white balance changed, RGB Gain mode */
#define TCAM_EVENT_ERROR         0x0080    /* generic error */
#define TCAM_EVENT_DISCONNECTED  0x0081    /* camera disconnected */
#define TCAM_EVENT_TIMEOUT       0x0082    /* timeout error */

#ifdef _WIN32
tcam_ports(HRESULT)      Tcam_StartPullModeWithWndMsg(HTCam h, HWND hWnd, UINT nMsg);
#endif

Would the attached png be a proper implementation of this function in LV?
I'm lost at the 'HWND hWnd' parameter.
HTCam h is the identifier of the camera (it works in other functions).
UINT nMsg would identify one of the 9 messages (I believe). 

LV_API.png

Thanks!

Mohit.

0 Kudos
Message 1 of 2
(3,079 Views)

Per https://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx:

 

HWND is a Windows type for a handle to a window. It's declared with

typedef HANDLE HWND;

so it's the same thing as type HANDLE, which is a handle to an object; it's declared with

typedef PVOID HANDLE;

so it's the same thing as a PVOID, which is a pointer to any type, declared with

typedef void *PVOID;

So a HWND is essentially a pointer. Whether it's 32- or 64-bit depends on the flavor of Windows that you're using. The documentation for your API should give more details on what window's handle you'd pass into this function.

0 Kudos
Message 2 of 2
(3,060 Views)