From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use autoit in labview to maximize and set top window not working?

Solved!
Go to solution

Just starting using autoit and most window control commands work great but I cannot get WINSETONTOP AND WINSETSTATE functions to work.  All looks good but keeps showing missing terminal wiring.  I checked to see if I could change write, but not available.  Also tried using properties SW_SHOWMAXIMIZED and SW_MAXIMIZE.  I have attached the Labview 10 code and hopefully a snop shot here.  Can someone send me a working example or provide details as to what the problem may be.

 

Thanks!

Shannon

Shannon F
Download All
0 Kudos
Message 1 of 6
(5,582 Views)

I have used AutoIt in the past and have posted a few examples. One thing I noticed about your code is that you do not have the "strTitle" parameter of the Invoke node wired. You have it on the other ones, though. Also, I don't know if this is still true with the current version of AutoIt, but one thing I discovered is that with methods that took in strings I had to wire an empty string to the input if it wasn't being used. So, for those methods where you are not using one of the string inputs (such as "strText") try wiring an empty string constant.

0 Kudos
Message 2 of 6
(5,545 Views)

Yes, StrTitle must be wired—had tried that and many other things, but not shown in my last attempt which is what I posted.  That must be wired too!

 

As far as StrText, it show OPTIONAL for

WinWait, WinActivate, WinWaitActivate (defined at http://www.autoitscript.com/autoit3/docs/functions/WinActivate.htm , for example)

 

But NOT WinSetState or WinSetOnTop (ones I was having problem with. 

(http://www.autoitscript.com/autoit3/docs/functions/WinSetState.htm , for example shows StrText = The text of the window to affect.  I am not sure what that means, exactly.

 

Have tried, empty string, nothing yet...Fixes wire error but window doesn’t maximize, I am using “32” as input because the WinGetState function returns that value for maximized, however, maybe this is wrong; I cannot find anything specify input for WinSetState (not sure why). 

 

Am playing around with properties also.  I will post when I get it figured out.

 

Thanks for your help and time!

Shannon F
0 Kudos
Message 3 of 6
(5,532 Views)
Solution
Accepted by topic author sfleming

Got it.

 

You were right, needed to wire empty charac set to StrTxt to get rid of the wire error.  Use property node as shown.  Not sure if this is how it is supposed to be coded but it is the only thing that has worked so far.

 

StrTxt is optional for others I am using.

 

This seems to work fine.

Shannon F
0 Kudos
Message 4 of 6
(5,528 Views)

Does this work from an exe??  I had a similar vi that controls a DOS program outside of Labview.  Using Auto It I can send input the DOS window no problem but when I build everything into the exe it doesn't work.  I can't activate the window for some reason.  Did you have that problem?

0 Kudos
Message 5 of 6
(4,761 Views)

Hi nelg87,

 

Can you describe what exactly you are trying to do with the DOS windows?  Is this executable being run on the same machine you are developing on?  My guess is that the ActiveX object is not being found from the executable because the path is not linked in the project build.  I'll try to look into if this can be specified. 

 

 

Brian

Brian G.
0 Kudos
Message 6 of 6
(4,745 Views)