Sign in to follow this  
Followers 0
Sunblood

WinSetState(title,text,@SW_MINIMIZE) not sending program to tray

8 posts in this topic

#1 ·  Posted (edited)

I'm using a program that will automatically hide itself and create a tray icon when it is minimized. However, the AutoIt way of minimization does not seem to activate this function for the program - it simply minimizes down to the task bar like any normal program would do.

Outside of directly sending keystrokes, how can I emulate an actual "minimize" button press for this program? ControlSend (and similar Control functions) are acceptable.

EDIT: More info:

The program is MME Audio Repeater from Virtual Audio Cable, for anyone wondering.

I can't just @SW_HIDE the program as it only creates the tray icon if it's minimized properly

Edited by Sunblood

Share this post


Link to post
Share on other sites

I'm not 100% sure what you are asking.

If you are just trying to minimize your AutoIt GUI then:

GUISetState(@SW_MINIMIZE)

If you are trying to minimize a different GUI then try using the AutoIt Window Info to get the exact title.

Share this post


Link to post
Share on other sites

When you press the Minimize button a trayicon is created but when you set the state of the program using WinSetState( $sTitle, $sText, @SW_MINIMIZE ) you don't get the trayicon.

If yes, then something under the hood is going on. You could just simulate the Clicking process on the Minimize button, I guess


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

When you press the Minimize button a trayicon is created but when you set the state of the program using WinSetState( $sTitle, $sText, @SW_MINIMIZE ) you don't get the trayicon.

If yes, then something under the hood is going on. You could just simulate the Clicking process on the Minimize button, I guess

Yeah that's the exact problem.

I could do it with mouseclicks but I'm looking for something more elegant to be able to automate the process without taking the active window.


Share this post


Link to post
Share on other sites

So is it the real minimize button like we have in a normal GUICreate or does it look somewhat other than that ?


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

I'll attach a picture of the program.

I want to emphasize this is NOT an AutoIt created GUI, it is an external program not made by me.

post-500-0-38883800-1365197385_thumb.png


Share this post


Link to post
Share on other sites

The NC Area doesn't seems to be of WindowsAPI, its user drawn control which is used to set the state of the window.

Have you tried Autoit Window Info Tool over that minimize button ?


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

You didn't explain well to understand what you want to do. Do you want to get your GUI minimized because the program is not getting minimized when you're running this code ?:

Opt("WinTitleMatchMode", 2)
WinSetState("Audio Repeater","",@SW_MINIMIZE)
Edited by Rickname

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0