LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to resize/move any window

Solved!
Go to solution

I don't know if it is possible but is there a way to resize wondows on the monitor that don't belong to a LabVIEW VI? I know you can move windows to the front with windows API calls but is it possible to resize ot move them? I just want to be sure I'm not on a wild goose chase.

0 Kudos
Message 1 of 7
(3,392 Views)

Have you looked into .NET or ActiveX calls?

0 Kudos
Message 2 of 7
(3,335 Views)
Call Win32 dll with LabVIEW and use related function
I think there is function that you can resize windows

http://labview360.com/forum/forum_uploads/files/jimmychen/2004-03-19_153916_an088.pdf
0 Kudos
Message 3 of 7
(3,311 Views)

The WinAPI function SetWindowPos will do both:

 

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

 

You can use MoveWindow, too:

 

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

 

Use the FindWindow function to get the window handle you need above:

 

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

 

 

0 Kudos
Message 4 of 7
(3,307 Views)

Windows API Function Utilities (32-bit) for LabVIEW

http://www.ni.com/example/29935/en/

 

 

George Zou
0 Kudos
Message 5 of 7
(3,292 Views)

That's great news. I was able to get a VI up and running to move and resize windows and child windows. I ran into an issue trying to control windows on a remote desktop session. I assumed they would be child windows of the desktop session but that doesn’t seem to be the case. Does anyone have an idea or possible way to get window handles for windows in a remote desktop session?

0 Kudos
Message 6 of 7
(3,252 Views)
Solution
Accepted by topic author Brandon.Baxter

A remote desktop session is basically just showing you an image of what's going on, it's not a proper program with child windows.

 

If you want to control those windows, you'd have to write a server app on the remote PC that your LabVIEW program communicates with.  You would have to send the server a message to resize the window and have the remote program run the actual resize.

0 Kudos
Message 7 of 7
(3,244 Views)