LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to detect Front Panel move event

This may be very simple as know one else seems to have had similar issues. I am trying to detect when the front panel window of a VI has been moved (ie user dragged the title bar and moved the window) Labview does not seem to provide a labview equivalent of this. Is there any way to handle the windows message?
0 Kudos
Message 1 of 12
(6,087 Views)
You can get the vi window position with a property node
(Front panel window/window bounds or panel bounds). Use the "Open VI Reference function", in the Application Control sub-palette.
Chilly Charly    (aka CC)
0 Kudos
Message 2 of 12
(6,086 Views)
Dear dynamic,

Thank you for contacting National Instruments.

To address your question, Chilly Charly is correct. If you use the Open VI Reference VI and wire the vi reference output into the reference input of a property node, you'll be able to access the panel or window bounds of the front panel.

Let me know if you have any further questions or if this does not resolve your issue.

Thanks again and have a great day!

Chad AE
Applications Engineer - National Instruments
0 Kudos
Message 3 of 12
(6,087 Views)
Thanks for both of your replies. Yes I am aware of using property nodes to acess the panel or window bounds.

Obviously you could just poll the bounds values to detect a change. However, I don't really want to have a loop just to do this. Is there anyway to tie the window bounds to an event so that when the values change it triggers an event.

Thanks again

Mike
0 Kudos
Message 4 of 12
(6,087 Views)
Is there any soultion now?I found that it can be done in CVI.
0 Kudos
Message 5 of 12
(5,594 Views)

Hi,

you can build your own function to receive a mvoe event. Use the Windows Message Queue Library and register the "WM_Move" Event. If you receive this event, then you can generate your own user event to use it inside the event structure.

 

Mike

0 Kudos
Message 6 of 12
(5,578 Views)

hi

 

If you want to find out the front panel  event position , you can initialize a mouse and acquire the input data.

0 Kudos
Message 7 of 12
(5,551 Views)
HI Mike, I have tried this method, The VI only response the mouse event, such as mouse_move event, mouse_leftbuttondown event. but it doesn't response the WM_MOVE(0x0003) event, so strange.
0 Kudos
Message 8 of 12
(5,513 Views)

Hi qzxin,

unfortunately you are right, this and some other messages are not forworded from LabVIEW to the vi. I think another solution would be to do all the stuff inside of a dll. You can register your vi (handle) inside your external code and also receive the move event there. Then you can send a User Event to your vi or you generate a dynamic LabVIEW Event.

 

Hope it helps.

Mike

0 Kudos
Message 9 of 12
(5,431 Views)

Is there any news on this problem? I need to do the exact same thing.

Maybe someone already tried to write a DLL?

 

Ingo

0 Kudos
Message 10 of 12
(5,386 Views)