LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pb with Get Window RefNum in LVWUTIL32

I'm using Get Window RefNum from LVWUTIL32 under Windows 2000.
It's work fine with windows from other applications or with windows create from application to show an image.
But this function return an error (6002) when i'm enter the name of the main window. I have this problem with the example of get mouse position.
I tried to change the name of the application window : same problem.

Thanks
0 Kudos
Message 1 of 3
(3,784 Views)
pdx,

Apprently,the error occurs because this VI compares the top level VI name (from VI server) to the actual Window Title name.There's no known fix yet for that problem.

Regards,

Cyril Bouton
Applications Engineer
National Instruments
Cyril Bouton
Active LabVIEW Developper
0 Kudos
Message 2 of 3
(3,784 Views)
I have found a solution for this problem onto WIN2000.

You should use an other API call from the windows library. The syntax in VB code is :

Declare Function WindowFromPointXY Lib "User32" Alias _
"WindowFromPoint" (ByVal xPoint As Long, ByVal yPoint As Long) _
As Long

In labview make a call on this function, when you clic on the run button for example, or an other.

After you can test if the windows is OK. Labview as a function who return the complete string of the running VI.

With the API call :
Declare Function GetWindowText Lib "User32" Alias _
"GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, _
ByVal cch As Long) As Long

you have the name of the windows. Just transmit the handle of the
windows you have had with the cursor position.

I have send an attachment to explain this case.
0 Kudos
Message 3 of 3
(3,784 Views)