# GetCVIWindowHandleForCurrThread

int GetCVIWindowHandleForCurrThread (void);

## Purpose

Returns the window handle associated with the current thread of your LabWindows/CVI application.

Linux This function is not supported.

You can use this number as the hwnd parameter to the Windows PostMessage function, as indicated in the Windows SDK documentation. For this action to work, call RegisterWinMsgCallback and GetCVIWindowHandle and then pass their return values (uMsg and hwnd) to the DLL. When the DLL wants to send a message , it calls PostMessage with these values. When LabWindows/CVI receives the message, it calls the callback function.

| Note LabWindows/CVI can receive the message only when it is processing events. LabWindows/CVI processes events when it is waiting for user input. If the program running in LabWindows/CVI does not call RunUserInterface, GetUserEvent, or scanf, or if it does not return from a User Interface Library callback, events are not processed. To avoid this problem in the program, call the User Interface Library function ProcessSystemEvents periodically.

## Parameters

None.

## Return Value

Name | Type | Description
windowHandle | integer | The window handle associated with the current thread of your LabWindows/CVI application. You can use this number as the hwnd parameter to the Windows PostMessage function, as indicated in the Windows SDK documentation.