akorx Posted February 26, 2015 Share Posted February 26, 2015 Hi, Sometimes a windows has a max size fixed by the developers; a user can resize it with the mousse... Is there a way with autoit to resize (= to restore) this windows at her "normal" size (this "normal" size is the defaut size when we start the program). AkorxMail akorx@yahoo.fr Link to comment Share on other sites More sharing options...
Xenobiologist Posted February 26, 2015 Share Posted February 26, 2015 Have alook at Win... functions e.g. WinMove. Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
akorx Posted February 26, 2015 Author Share Posted February 26, 2015 (edited) I know WinMove() but this function resize the program with my choices but not with her original size... I think something like WinSetState($hWnd, "", @SW_SHOWNORMAL) could be a solution but I doesn't work. Is there another way with a windows function (or another autoit function that I've not seen) ? Edited February 26, 2015 by akorx AkorxMail akorx@yahoo.fr Link to comment Share on other sites More sharing options...
akorx Posted February 26, 2015 Author Share Posted February 26, 2015 Should I ask autoit's developers to add something like @SW_RESET to do this? AkorxMail akorx@yahoo.fr Link to comment Share on other sites More sharing options...
iamtheky Posted February 26, 2015 Share Posted February 26, 2015 (edited) no, just capture the values and then use winmove. This demo will open notepad, capture the original size with wingetpos, reshape it, then put it back using the array from wingetpos. opt("WinTitleMatchMode" , 2) ShellExecute("notepad.exe") sleep(1000) $hWindow = WinGetHandle("Notepad") $aOriginalSize = WinGetPos($hWindow) winmove($hWindow , "" , 160 , 200 , 340 , 400) sleep (2000) winmove($hWindow , "" , $aOriginalSize[0] , $aOriginalSize[1] , $aOriginalSize[2] , $aOriginalSize[3]) sleep (2000) processclose("notepad.exe") Edited February 26, 2015 by boththose ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
akorx Posted February 26, 2015 Author Share Posted February 26, 2015 The problem is that I can't capture the original size because my script doesn't run when the other program starts... AkorxMail akorx@yahoo.fr Link to comment Share on other sites More sharing options...
iamtheky Posted February 26, 2015 Share Posted February 26, 2015 Unless defaults are hard coded somewhere readable like a settings file or the registry I think you will have to use magic. ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
akorx Posted February 26, 2015 Author Share Posted February 26, 2015 "magic" ? what is it? AkorxMail akorx@yahoo.fr Link to comment Share on other sites More sharing options...
TheSaint Posted February 26, 2015 Share Posted February 26, 2015 I'm guessing you've tried the other WinSetState options, like @SW_RESTORE and @SW_MAXIMIZE They should work if the resizing mechanism is correctly specified, else you are probably out of luck. Can you make the window bigger than it is supposed to be? If not, then you could loop through resizing (WinMove) and checking (WinGetPos) until it stops changing size. You could then store the final value for future use, to avoid the loop method again. Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
iamtheky Posted February 26, 2015 Share Posted February 26, 2015 (edited) So far I have gathered that you want to start a process that retrieves historical application-specific information that is probably not logged. That requires you to be a wizard. Unless of course there is anywhere you can go manually to see the default coordinates and size and then we can try and go read that. Edited February 26, 2015 by boththose ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now