updating codes to a 4k monitor

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
AmDeG 11
Posts: 388
Joined: 28 Nov 2013, 11:42

updating codes to a 4k monitor

21 Jul 2018, 17:13

I have a file with many scripts for an old monitor (1920 x 1080).

Is there a way that all my scripts get updated proportionally to my new 4x monitor (3840 x 2160)?
garry
Posts: 3760
Joined: 22 Dec 2013, 12:50

Re: updating codes to a 4k monitor

22 Jul 2018, 04:07

try to use a_screenwidth /-height
EDIT : added color buttons
a GUI example :

Code: Select all

#Warn
#NoEnv
SendMode,Input
SetWorkingDir, %A_ScriptDir%
SetTitleMatchMode,2
SetBatchLines, -1
FileEncoding, UTF-8
Gui,2:default
Gui,2: -DPIScale
SS_REALSIZECONTROL := 0x40
Gui,2:Font,s14 , Verdana
Gui,2:Color,Black

WinGetPos, TTX, TTY, TTW, TrayHeight, ahk_class Shell_TrayWnd,,,
HA    :=(A_screenheight-TrayHeight)
WA    :=(A_screenwidth)

xx:=100.4
GW    :=(WA*99.9)/xx      ;- width    Gui Width
GH    :=(HA*99  )/xx      ;- height   Gui Height

;------------- example some color buttons -----------
i=0
y   :=(ha*1.01)/xx
x   :=(wa*1.66)/xx
LY1 :=(HA*95  )/xx
w   :=(wa*5   )/xx
h   :=(ha*2.5 )/xx
sect1=Check-XY,Default,YT_SIZE,LAST,QUIT,Youtube,Archive,NL_Archive,UK_Pathe,PT_Oldies,NL_Lubach,US_Oldies,RU_Masha
sect=%sect1%
stringsplit,k,sect,`,
           total:=k0
Gui,2:add,text,section x%x% y%ly1% w0 h0,
 Loop,%total%
    {
    i++
    ck:=k%a_index%
    Gui,2:Add,Progress, x+15   y%ly1% w%w% h%h%  Disabled BackgroundBlack
    if (i>5)
      Gui,2:Add,Text,     xp   yp  wp  hp   cGray    BackgroundTrans Center 0x200 gStart2 ,%ck%
    else
      Gui,2:Add,Text,     xp   yp  wp  hp   cYellow  BackgroundTrans Center 0x200 gStart2 ,%ck%
    }
;---------------------------------------------------

gui,2:show, x0 y0 h%gh% w%gw%,MENU %a_osversion% | %a_ostype% | 64bit=%a_is64bitos% | %wa%*%ha% | %a_username%=%a_isadmin% | %a_computername%
return

2GuiClose:
exitapp
;=========================================================================

Start2:
gui,2:submit,nohide
r:= a_guicontrol
goto,%r%
return

Check-XY:
Default:
YT_SIZE:
LAST:
QUIT:
Youtube:
Archive:
NL_Archive:
UK_Pathe:
PT_Oldies:
NL_Lubach:
US_Oldies:
RU_Masha:
msgbox, 262208,BUTTON-TEST ,%r%,2
return
Last edited by garry on 22 Jul 2018, 08:44, edited 1 time in total.
AmDeG 11
Posts: 388
Joined: 28 Nov 2013, 11:42

Re: updating codes to a 4k monitor

22 Jul 2018, 08:14

thanks! so how can I transform my current file with your GUI?
sorry I don't get it.
I simply want to have my file with the new numbers so as to be able to run my file at the 4x monitor computer
garry
Posts: 3760
Joined: 22 Dec 2013, 12:50

Re: updating codes to a 4k monitor

22 Jul 2018, 08:36

script above was just a GUI example , it works with FullHD or also with 4K Monitor
was calculating procent depending a_screenheight and a_screenwidth , maybe you must adapt your scripts this way (?)
( example : if you have a button with FullHD (1920) at position x1900 ( right border ) and you use 4k Monitor so the button is in the middle of the screen )
AmDeG 11
Posts: 388
Joined: 28 Nov 2013, 11:42

Re: updating codes to a 4k monitor

22 Jul 2018, 09:25

ok, but what I need is just a converter :
a script that can change the measures of my current .ahk script based on a 1920x1080 into my new 3840x2160
anybody knows how to do that?
superHiPO
Posts: 1
Joined: 22 Jul 2018, 12:25

Re: updating codes to a 4k monitor

22 Jul 2018, 12:40

Hi! If anyone can provide an answer to this issue, I'd really appreciate it as well!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: ntepa, scriptor2016 and 165 guests