Page 1 of 1

Changing minimum window size for a specific program

Posted: 11 Feb 2019, 12:10
by Putsnik
Hello! Is it possible to make a script to make a program's minimum window size, which is fixed, smaller without sacraficing any functions of the program/without removing any of the GUI? I heard some people had a similar problem with skype and even though It's not about skype now, maybe the same script will work for the program I have in mind also? Any informative input will be appreciated!

Re: Changing minimum window size for a specific program

Posted: 11 Feb 2019, 17:51
by gregster
So how did these people solve this problem with Skype? Where is the "same script" that might work?

Of course, people can try to google it, but if you already found something related, it will probably increase your chances to get help, if people don't have to start looking for it themselves. (You already posted a similar (now deleted ?) request yesterday, if I remember correctly.) It might depend on the specific program, though, what can be done.

Re: Changing minimum window size for a specific program

Posted: 11 Feb 2019, 23:51
by Putsnik
Now when I re-read the thread about skype it seemed that they didnt come up with a solution in that particular thread. Though these 2 threads had some interesting scripts that I think might be able to override the minimum size:

https://autohotkey.com/board/topic/55365-make-window-smaller-than-allowed-minimum-size/

https://autohotkey.com/board/topic/2311-minimum-resize-width-gui/

Im completely new with AHK so I have to admit I dont have the skills to apply their scripting to solve the issue for my program. Thats why im asking help from you guys here. I mean a good script should be able to overcome the size limitations in most programs right?

Re: Changing minimum window size for a specific program

Posted: 12 Feb 2019, 09:19
by gregster
Putsnik wrote:
11 Feb 2019, 23:51
I mean a good script should be able to overcome the size limitations in most programs right?
Usually, developers have something in mind when they prescribe a minimum window size. Even if you can reduce the window size yourself, there is no guarantee that the control elements in the GUI will resize accordingly or that the GUI will stay in that smaller size (as I understand you, you don't want to just cut off a not needed part of the GUI - even then you usually get no satisfying results with Winset, Region) . But I personally have very little experience with such resizing attempts of third-party programs - but I am quite sure that different programs won't always react the same way.

If you just need to extract some information of the GUI, you can try to read it via AHK; WindowSpy.ahk, which is included with AHK, would be the first step to test if you can get any info from a specific GUI. But if the GUI doesn't have standard Windows control elements, things can get much more difficult.

I personally would contact the developers of the specific program first and ask them politely if they could change the minimum size of the GUI in their next version. While Microsoft might ignore you, smaller software companies are often much more open to such requests. (But like I said, there might be certain functional or other restrictions that might prevent this).

Re: Changing minimum window size for a specific program

Posted: 12 Feb 2019, 13:13
by Putsnik
I actually did talk to one of the devs of the program right before making this thread. In short he said that it would take too much time for them to re-program the minimum size. But he said that an AHK script might be able to work, whether it would inpact the GUI or not he wasn't completely sure. But this has to able to be achieved in some way either with AHK script or with some other program right?

Im not quite sure how to make use of the information with window spy but maybe you can help me?
https://imgur.com/a/DQ1MIwj does this picture of window spy say if the program has standard windows control elements?

Also am I the only one who gets http error 500 every single time when trying to post here? I havent' been able to post for 4 hours now.

Re: Changing minimum window size for a specific program

Posted: 12 Feb 2019, 15:25
by gregster
Well, we have some users experiencing massive amounts of captchas and also problems to post - some none at all (like me ;) ), because the admins had to beef up firewall and other forum rules due to massive spamming, very recently - obviously, these rules need more fine-tuning. Perhaps your problems are connected to this. If you have some more details, you could post them in the 'Forum Issues' subforum; there should be already a few threads about this.
does this picture of window spy say if the program has standard windows control elements?
It seems that it is some windows element, but it could be a rather complex one which could complicate it.

At first, you could simply try to resize it by trying to use WinMove (please change the size parameters accordingly):

Code: Select all

1::WinMove, ahk_exe PioViewer.exe, , , , 300, 300   ; last two numbers mean width and height in pixels
Hit the 1 key to resize the window.
But I am not sure if this will allow smaller sizes than the program offers. If I try this on the windows calculator calc.exe on Win10, I can enlarge the window, but I cannot reduce its size under a certain minimum.

Perhaps someone has a better idea for the resizing - like I said, this is not really something I have experience with.
In short he said that it would take too much time for them to re-program the minimum size.
If this is true, I am not very optimistic that AHK or other tools can help much - this could indicate that the implemented control elements won't resize correctly with the GUI.

Re: Changing minimum window size for a specific program

Posted: 12 Feb 2019, 15:40
by gregster

Re: Changing minimum window size for a specific program

Posted: 12 Feb 2019, 21:47
by qwertyuu
Putsnik wrote:
12 Feb 2019, 13:13
Also am I the only one who gets http error 500 every single time when trying to post here? I havent' been able to post for 4 hours now.
Not able to post either :( What's up with that?

Re: Changing minimum window size for a specific program

Posted: 14 Feb 2019, 02:22
by Putsnik
I did try out the WinMove script but didnt work as expected. But there should be a script out there that does apply new minimum size by removing some of the GUI? Maybe I have to work with that for starters. I also tried out both ''resize enable'' and ''Sizer'' which both didnt wanna work with the PioViewer. I mean as I start to learn more about this it seems to be harder to implement a new minimum size than I originally thought but it can't be impossible right? I'll will even pay the guy 30-50$(as long as this is within the rules of the forum of course), who comes up with a solution. It has to not impact the GUI and work decently smooth though.

After 1 whole day of not being able to post I was able to post now. It seems that quoting someone is interfering with being able to post because when I removed my quotation that was ment to Gregster I did manage to post atlast.

Re: Changing minimum window size for a specific program

Posted: 15 Feb 2019, 06:55
by Putsnik
Bumped

Re: Changing minimum window size for a specific program

Posted: 01 Mar 2019, 14:14
by Putsnik
I will offer 50-100$ to anyone who could solve what I am asking for above. Please get in contact with me if you think you'll have a solution.

Re: Changing minimum window size for a specific program

Posted: 20 May 2021, 03:01
by eqv
Putsnik wrote:
01 Mar 2019, 14:14
I will offer 50-100$ to anyone who could solve what I am asking for above. Please get in contact with me if you think you'll have a solution.
Not sure if you already solved it, but here is a solution I found (by accident):

Code: Select all

Run, notepad,,, v
WinWait, % "ahk_pid " v

x:=0 , y:=0 , w:=3000 , h:=750		;;  change this values

DllCall("SetWindowPos"
    , "UInt", WinExist("ahk_class Notepad")	   ;;  window.id
    , "UInt", 0
    , "Int" , x					   ;;  X-position
    , "Int" , y					   ;;  Y-position
    , "Int" , w					   ;;  Width
    , "Int" , h					   ;;  Height
    , "UInt", 0x0400)			   ;;  HERE IS THE MAGIC { ! }

;;  https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos
( some clarification ) Aparently, the "minimun size" is calculated after the window recives a messages of position. Therefore:
• If press on the border, then the program will resize to its minimun.
• If press on the wintitle, then the program will resize to its minimun.

The functions inside the program, should work normally.
So, if you want to avoid accidentally resize it, I would advice to remove the title and border of the program (use <WinSet, Style>).

I hope you find it useful.
Cheers,