I created a phone book but the close option does not appear

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
fmildemberger
Posts: 29
Joined: 22 Jan 2014, 10:31

I created a phone book but the close option does not appear

Post by fmildemberger » 14 Jul 2022, 14:36

USING THE SCRIPT DESCRIBED HERE I CREATED A PHONE BOOK BUT THE CLOSE OPTION DOES NOT APPEAR, CAN ANYONE HELP ME?

Code: Select all

#Singleinstance, force
Width := 230
Gui, +LastFound
WinSet, Transparent, 180
Gui, Color, 99a2d5
Gui, Margin, 0, 0
Gui, Font, s14 fbf8f8 Bold
Gui, Add, Progress, % "x-1 y-1 w" (Width+2) " h31 Background4d5db6 Disabled hwndHPROG"
Control, ExStyle, -0x20000, , ahk_id %HPROG% ; propably only needed on Win XP
Gui, Add, Text, % "x0 y0 w" Width " h60 BackgroundTrans Center 0x260 gGuiMove vCaption", AAHC
Gui, Font, s7
Gui, Add, Text, x20 y+20 w190 r1 +0x4000 vTX1 gRECEPCAO, RECEPCAO
Gui, Add, Text, x20 y+20 w190 r1 +0x4000 vTX2 gti, TI
Gui, Add, Text, x20 y+20 w190 r1 +0x4000 vTX3 gRH, RH
Gui, Add, Text, x20 y+20 w190 r1 +0x4000 vTX4 gFINANCEIRO, FINANCEIRO
Gui, Add, Text, x20 y+20 w190 r1 +0x4000 vTX5 gREGULA, REGULATORIO
Gui, Add, Text, x20 y+20 w190 r1 +0x4000 vTX6 gCTARECEBER, CONTAS A RECEBER
Gui, Add, Text, x20 y+20 w190 r1 +0x4000 vTX7 gCOMPRAS, COMPRAS
Gui, Add, Text, x20 y+20 w190 r1 +0x4000 vTX8 gSUPER, SUPERINTENDENTE
Gui, Add, Text, x20 y+20 w190 r1 +0x4000 vTX9 gMARKETING, MARKETING
Gui, Add, Text, x20 y+20 w190 r1 +0x4000 vTX10 gSECRETARIA, SECRETARIA
Gui, Add, Text, x20 y+20 w190 r1 +0x4000 vTX11 gTELEMARKETING, TELEMARKETING
Gui, Add, Text, x20 y+20 w190 r1 +0x4000 vTX12 gCEDIVIDA, CEDIVIDA
Gui, Add, Text, x20 y+20 w190 r1 +0x4000 vTX13 gClose, FECHAR
Gui, Add, Text, x20 y+20 w190 h5 vP
GuiControlGet, P, Pos
H := PY + PH
Gui, -Caption
WinSet, Region, 0-0 w%Width% h%H% r6-6
Gui, Show, % "w" Width " NA"
Gui, Show, % "w" Width " NA" " x" (A_ScreenWidth - Width) " y150"
WinSet AlwaysOnTop
return

GuiMove:
PostMessage, 0xA1, 2
return

RECEPCAO:
MsgBox,  HELEN 200
return

TI:
MsgBox, TI 206
return

RH:
return
MsgBox, PRISCILA | MARCILEIDE 233

FINANCEIRO:
MsgBox, ANDRESSA 213
return

REGULA:
MsgBox, TATIANA 213
return

CTARECEBER:
MsgBox, FRANCIELLI 232
return

COMPRAS:
MsgBox, TATIANE-234  ROSI-220
return

SUPER:
MsgBox, Ramal 202
return

MARKETING:
MsgBox, Ramal 214
return


SECRETARIA:
MsgBox, Ramal 218
return


TELEMARKETING:
MsgBox, Ramal 224-SUELI | RAMAL 229-VANESSA
return


CEDIVIDA:
MsgBox, MARCO|MONIQUE - 231
return




Close:
ExitApp
[Mod edit: [code][/code] tags added.]
Last edited by gregster on 14 Jul 2022, 17:57, edited 1 time in total.
Reason: Topic was split from unrelated topic. Also, please check xou capslock key - it seems broken! Thank you!

User avatar
mikeyww
Posts: 27366
Joined: 09 Sep 2014, 18:38

Re: I created a phone book but the close option does not appear

Post by mikeyww » 14 Jul 2022, 18:16

Your Winset, Region sets the region. If you don't want it, delete it.

fmildemberger
Posts: 29
Joined: 22 Jan 2014, 10:31

Re: I created a phone book but the close option does not appear

Post by fmildemberger » 15 Jul 2022, 10:40

the close option still doesn't appear, even commenting out the line Winset, Transparent , 180
address book.jpg
address book.jpg (152.3 KiB) Viewed 1269 times

User avatar
flyingDman
Posts: 2848
Joined: 29 Sep 2013, 19:01

Re: I created a phone book but the close option does not appear

Post by flyingDman » 15 Jul 2022, 12:16

Add gui,-dpiscale near the top
14.3 & 1.3.7

User avatar
kczx3
Posts: 1649
Joined: 06 Oct 2015, 21:39

Re: I created a phone book but the close option does not appear

Post by kczx3 » 15 Jul 2022, 12:23

Perhaps your DPI scaling is set to greater than 100%?

User avatar
neovis
Posts: 34
Joined: 12 Jun 2022, 03:56
Location: Republic of Korea
Contact:

Re: I created a phone book but the close option does not appear

Post by neovis » 15 Jul 2022, 13:03

Add the calculation below to scale according to dpiscale.

Code: Select all

Width := Width*a_screenDPI/96
H := (PY+PH)*a_screenDPI/96

fmildemberger
Posts: 29
Joined: 22 Jan 2014, 10:31

Re: I created a phone book but the close option does not appear

Post by fmildemberger » 15 Jul 2022, 14:24

with these changes presents the error shown in the figure
address1.jpg
address1.jpg (56.07 KiB) Viewed 981 times

User avatar
flyingDman
Posts: 2848
Joined: 29 Sep 2013, 19:01

Re: I created a phone book but the close option does not appear

Post by flyingDman » 15 Jul 2022, 14:54

You can either have the gui "ignore" dpiscaling using gui, -dpiscaling or adjust your dimensions using a correction factor = a_screenDPI/96.
As you hardcoded the width, it does not make much sense to correct it.
14.3 & 1.3.7

garry
Posts: 3795
Joined: 22 Dec 2013, 12:50

Re: I created a phone book but the close option does not appear

Post by garry » 15 Jul 2022, 16:11

an example GUI with color-buttons to Start URL/Program

Code: Select all

;-- Example GUI with color-buttons to Start URL/Program -----------
#warn
#NoEnv
name1=TEST
setworkingdir,%a_scriptdir%
Gui,2:default
Gui,2: -DPIScale -caption
transform,s,chr,127
WA:=A_screenwidth,HA:=A_screenheight,xx:=100
;-
;Gui,2:Color,C8D0D4,Black                  ;-gray
Gui,2: Color, 99a2d5
Gui,2:Font,s12 cBlack,Lucida Console
;-
clf:="",ckl:=""
;-------------------------------------------------
sectx=   
(Ltrim comments Join`r`n 
RECEPCAO; RECEPCAO
ti; TI
RH; RH
FINANCEIRO; FINANCEIRO
REGULA; REGULATORIO
CTARECEBER; CONTAS A RECEBER
COMPRAS; COMPRAS
SUPER; SUPERINTENDENTE
MARKETING; MARKETING
SECRETARIA; SECRETARIA
TELEMARKETING; TELEMARKETING
CEDIVIDA; CEDIVIDA
CLOSE;FECHAR
)
;---------------------
loop,parse,sectx,`n,`r
  {
  x:=a_loopfield
  stringsplit,k,x,`;
  clf .= k1 . s
  ckl .= k2 . s
  }
stringsplit,A1v,clf,%s%
stringsplit,A2v,ckl,%s%
totx:=(A1v0-1)
;---------------------
x:=(wa*1)/xx,y:=(ha*2)/xx,w :=(wa*13 )/xx,h:=(ha*2.5)/xx,v:=(ha*.5)/xx
Gui,2:add,text,section x%x% y%y% w0 h0,
i:=0
Loop,%totx%
  {
  i++
  btname:="" , column2:=""
  BTName := A1v%i% ,  column2:= A2v%i%
  if (btname="close")
    {
    Gui,2:Add,Progress,            xs y+%v% w%w%  h%h%  Disabled BackgroundYellow
    Gui,2:Add,Text,                xp    yp     wp    hp   cRED  BackgroundTrans Center 0x200 gStart1 v%btname%_%i% ,%btname%
    } 
  else
    {
    ;Gui,2:Add,Progress,            xs y+%v% w%w%  h%h%  Disabled Background0xC8D0D4
    Gui,2:Add,Progress,            xs y+%v% w%w%  h%h%  Disabled BackgroundBlack
    Gui,2:Add,Text,                xp    yp     wp    hp   cYellow  BackgroundTrans Center 0x200 gStart1 v%btname%_%i% ,%btname%
    } 
  }
x:=(wa*84.9)/xx,y:=(ha*1)/xx,w:=(wa*15)/xx,h:=(ha*44)/xx             
Gui,2:Show, x%x% y%y% h%h% w%w%,%name1%
return
;-------------------------------------------------------------------------
2Guiclose:
exitapp
esc::exitapp
;-------------------------------------------------------------------------

;--------------- start --------------------------
start1:
gui,2:submit,nohide
Mousegetpos,,,,Ctrl       ;- Button1
r:= a_guicontrol          ;- vVar ( Buttonname )
stringtrimleft,ct,ctrl,6  ;- Button-(1)
ct:=ct-1
url:= A2v%ct%
;msgbox, 262208, ,R=%r%`nCT=%ct%`nCTRL=%ctrl%`nURL=%url%
if (url="FECHAR")
  exitapp
else
 {  
 try
   msgbox, 262208,TEST ,%url%,1.5
 }  
return

;=================== END SCRIPT =============================================

fmildemberger
Posts: 29
Joined: 22 Jan 2014, 10:31

Re: I created a phone book but the close option does not appear

Post by fmildemberger » 15 Jul 2022, 16:20

you are the best!
thanks garry !!!

Post Reply

Return to “Ask for Help (v1)”