LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Link hwnd window handle to Front Panel monitor index

Hi all,

 

I am using a multiple monitor setup with TestStand/Labview programs. Depending on the monitor space i need or other things i am doing, i place the TestStand window on one of my monitors. Labview front panels however allways display at the primary monitor. I would like them to display at the same monitor where TestStand is running.

 

I found that i can set the monitor where the labview front panel is displayed by setting the FP.Monitor property of the vi.

 

I also found that i can detect the monitor where TestStand is displayed by putting its window handle (hwnd from RunState.Engine.AppMainHwnd) in the user32.dll function "MonitorFromWindow". This returns a monitor handle (HMONITOR). This handle changes when i move the Teststand window from one monitor (value 65539) to another (value 65537).

 

With the monitor handle i can retreive a "MONITORINFO" struct using the "GetMonitorInfo" function. I cant find a number or index in this struct indicating which monitor it describes. How can i link the monitor handle to the corresponding FP.Monitor value?

 

Thanks in advance,

Stef

0 Kudos
Message 1 of 1
(2,793 Views)