Hi Guys,
I wrote a script in 1920x1080p resolution, but working in lower resolutions cuts off some part of my GUI. Is there a way to detect the system resolution (Sysget) and autofit a gui inside the resolution chosen?? Thanks in advance.
Best Answer Snipershot , 13 April 2014 - 01:04 PM
Hi Guys,
I wrote a script in 1920x1080p resolution, but working in lower resolutions cuts off some part of my GUI. Is there a way to detect the system resolution (Sysget) and autofit a gui inside the resolution chosen?? Thanks in advance.
OnMessage(0x7E, "AutofitGui") AutofitGui(w, l) { MsgBox % "new monitor resolution: " . l & 0xffff "x" . (l >> 16) & 0xffff ; resize code here }
Thanks man, but what would be this resize code?
For instance, I have a button at w1300, but it wont appear in a 1024x768 monitor. Thats what I would like to. A code to fit all outside GUI controls. Its because I will install and run the script in many diffent kind of machines, so I need to detect the current resolution and the script would fit all controls inside. Is it possible or have I to set control values for each resolution?
Or at least, vertical and horizontal bars to scroll and view the offscreen content..
Look into using anchor.ahk
Marine Corps Gen. Joseph Dunford told senators at his Joint Chiefs of Staff confirmation hearing : “If you want to talk about a nation that could pose an existential threat to the United States, I'd have to point to Russia. And if you look at their behavior, it's nothing short of alarming.”
I tried it. One problem o first try. When I maximize the window the listview increases its width to a not proportional measure. If I restore the window, everything goes back to normal, but when maximize again in messes with my listview width. My script starts maximized so it already starts messed. Any suggestion?
I am using:
----------
try
Anchor("LV1", "wh")
Marine Corps Gen. Joseph Dunford told senators at his Joint Chiefs of Staff confirmation hearing : “If you want to talk about a nation that could pose an existential threat to the United States, I'd have to point to Russia. And if you look at their behavior, it's nothing short of alarming.”
Tried. But now the function do not work when resizing. It starts maximized correctly, but when I resize nothing happens. I was using a modified version of Anchor, replace by original one.
Can you post your script?
Marine Corps Gen. Joseph Dunford told senators at his Joint Chiefs of Staff confirmation hearing : “If you want to talk about a nation that could pose an existential threat to the United States, I'd have to point to Russia. And if you look at their behavior, it's nothing short of alarming.”
Here, thanks for helping! Using Anchor 4.60a - Lastest version.
Guess I found the problem ... was usinh 64 bit version of ahk. Chaged to ansi 32 and looks like its working now... will check deeply
That is a big (and good looking) gui. As most of the controls will need to be subject to Anchor, it will take some time to get it right. But it can be done!. Here is an example of how 3 list boxes move together to fill the window. The trick is to get the coefficients right.
#singleinstance force gui, +resize gui, add, listview, w200 r20 vLV1, a|b|c gui, add, listview, x+10 w300 r20 vLV2, a|b|c gui, add, listview, x10 y+10 w510 r10 vLV3, a|b|c gui, show, hide ,test WinWait, test gui, show, maximize ,test gui, show, ,test return Guisize: Anchor("LV1", "w.4h.66") Anchor("LV2", "x.4w.6h.66") Anchor("LV3", "y.66wh.33") return
Marine Corps Gen. Joseph Dunford told senators at his Joint Chiefs of Staff confirmation hearing : “If you want to talk about a nation that could pose an existential threat to the United States, I'd have to point to Russia. And if you look at their behavior, it's nothing short of alarming.”
Thanks a lot for the help. I will have a lot of work, but now I know it is possible.!!