Sign in to follow this  
Followers 0
Day

@SW_MINISIZE has no effect

7 posts in this topic

1. I have installed AutoIt3. And things goes well except that every time SciTE starts with maxisize. I found no option to change. I tried to write my own exe to launch SciTE using Run with the flag @SW_MINISIZE, however it has no effect on SciTE, when it starts, it still has the maxisize. Anybody can help me?

2. Another question, can i write a script using Run, with the first parameter properly set to make it run an app from the relative dir(Eg. i want a script which can run an app in a folder in my USB)? Any idea?

Thank you.

Share this post


Link to post
Share on other sites



1. I have installed AutoIt3. And things goes well except that every time SciTE starts with maxisize. I found no option to change. I tried to write my own exe to launch SciTE using Run with the flag @SW_MINISIZE, however it has no effect on SciTE, when it starts, it still has the maxisize. Anybody can help me?

2. Another question, can i write a script using Run, with the first parameter properly set to make it run an app from the relative dir(Eg. i want a script which can run an app in a folder in my USB)? Any idea?

Thank you.

Well in your post, last time I checked, @SW_MINIMIZED wasn't spelt that way....

Make sure your spelling is correct! :) WinSetState is also a good start :D

Share this post


Link to post
Share on other sites

1. I have installed AutoIt3. And things goes well except that every time SciTE starts with maxisize. I found no option to change. I tried to write my own exe to launch SciTE using Run with the flag @SW_MINISIZE, however it has no effect on SciTE, when it starts, it still has the maxisize. Anybody can help me?

SciTE doesn't "listen" and want to have its own way as defined in the properties files for Window state. something like this will do it for you:

Opt("WinTitleMatchMode", 2) 
Run(@ProgramFilesDir & "\AutoIt3\Scite\Scite.exe")
WinWait("SciTE")
WinSetState("SciTE",'',@SW_MINIMIZE)

2. Another question, can i write a script using Run, with the first parameter properly set to make it run an app from the relative dir(Eg. i want a script which can run an app in a folder in my USB)? Any idea?

sure thing .... Run("..\pgm.exe") will look for the program in the parent directory of the script directoy.

:)


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Bert, thanks for your kindness. :D I did not notice that i had misspelled that macro.

Jdeb, thanks for your help. The second is OK now. :) But the first solution does not work. Because SciTE has buffers, it automatically remember the file you opened last time. When use your code to open it, the title can not match, since the title is in fact with the form: Path\File *SciTE4AutoIt3. You can not get matched every time because you can not expect what au3 file you will open next time and SciTE always remembers the last one you opened. Thank you anyway. :D

How about others, any idea to help me solve this problem? Thanks.

Share this post


Link to post
Share on other sites

Jdeb, thanks for your help. The second is OK now. :) But the first solution does not work. Because SciTE has buffers, it automatically remember the file you opened last time. When use your code to open it, the title can not match, since the title is in fact with the form: Path\File *SciTE4AutoIt3. You can not get matched every time because you can not expect what au3 file you will open next time and SciTE always remembers the last one you opened. Thank you anyway. :D

How about others, any idea to help me solve this problem? Thanks.

Lost you ... The Editor name is always the same and my script only test a partial of the Window Title since i put " Opt("WinTitleMatchMode", 2) " in the script.

the text "SciTE" is alwasy there what ever version you use or files you have opened.

:D


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Bert, thanks for your kindness. :D I did not notice that i had misspelled that macro.

Jdeb, thanks for your help. The second is OK now. :) But the first solution does not work. Because SciTE has buffers, it automatically remember the file you opened last time. When use your code to open it, the title can not match, since the title is in fact with the form: Path\File *SciTE4AutoIt3. You can not get matched every time because you can not expect what au3 file you will open next time and SciTE always remembers the last one you opened. Thank you anyway. :D

How about others, any idea to help me solve this problem? Thanks.

When you use the run() command, it returns the PID of the newly launched program. You can use this to identify the window.

Opt("WinTitleMatchMode", 4)
local $wPid=Run(@ProgramFilesDir & "\AutoIt3\Scite\Scite.exe")
local $WinL=WinList()
local $WinID[2]
while $WinID[1]=""
sleep(50)
For $i = 1 to $WinL[0][0]
if WinGetProcess($WinL[$i][1])=$wPid then 
$WinID[0]=$WinL[$i][0]
$WinID[1]=$WinL[$i][1]
exitloop
endif
next
wend
WinWait($WinID[0])
WinSetState($WinID[0],'',@SW_MINIMIZE)

However, none of this should actually be necessary; Opt("WinTitleMatchMode", 2) means that, when looking for a particular window, AutoIT should recognize a match so long as any part of the string is present in the title of any window. This being the case, JdeB's solution should work just fine.

EDIT: JdeB beat me to it! (explaining why his will work, that is)

Edited by improbability_paradox

Share this post


Link to post
Share on other sites

Done. Thank you two. :)

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