Jump to content

Find min and max size of a windows


akorx
 Share

Recommended Posts

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

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

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 by akorx

AkorxMail akorx@yahoo.fr

Link to comment
Share on other sites

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 by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

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

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)

userbar.png

Link to comment
Share on other sites

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 by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...