AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Why does ahk overflow on this gui after gui.nr 99

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Dazzle
Guest





PostPosted: Tue Sep 16, 2008 11:09 pm    Post subject: Why does ahk overflow on this gui after gui.nr 99 Reply with quote

There is probaly a better way of counting a number in a gui, but that is not my intention.

What do I got todo too create more then 99 gui's.

My code

Code:


loop{

Gui, %A_index%:Color, FFFFDA
Gui, %A_index%:+AlwaysOnTop -SysMenu
Gui, %A_index%:Font, s50,Verdana
Gui, %A_index%:Add, Text, x75 y75, %A_index%

Gui, %A_index%:Show, h250 w250 , Loop Count %A_index%

sleep, 50

Gui, %A_index%:Destroy
}
 


Greetz,
Dazzle
Back to top
Superfraggle



Joined: 02 Nov 2004
Posts: 1019
Location: London, UK

PostPosted: Tue Sep 16, 2008 11:33 pm    Post subject: Reply with quote

There is a limit to 99 Gui's..

Quote:
Each script may have up to 99 GUI windows simultaneously. To operate upon a window number other than the default, include a number followed by a colon in front of the sub-command as in these examples:

_________________
Steve F AKA Superfraggle

http://r.yuwie.com/superfraggle
Back to top
View user's profile Send private message MSN Messenger
T
Guest





PostPosted: Tue Sep 16, 2008 11:40 pm    Post subject: Reply with quote

this will keep going past 99 but as superfraggle says there is a limit of 99 guis
Code:

loop{

Gui, Color, FFFFDA
Gui,+AlwaysOnTop -SysMenu
Gui,Font, s50,Verdana
Gui, Add, Text, x75 y75, %A_index%

Gui, Show, h250 w250 , Loop Count %A_index%

sleep, 50

Gui,Destroy
}
Back to top
tank



Joined: 21 Dec 2007
Posts: 3700
Location: Louisville KY USA

PostPosted: Tue Sep 16, 2008 11:47 pm    Post subject: Reply with quote

i gotta know why you are numbering them in the first place since your destroying them
_________________

We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Back to top
View user's profile Send private message
Guest






PostPosted: Wed Sep 17, 2008 1:10 am    Post subject: Reply with quote

tank wrote:
i gotta know why you are numbering them in the first place since your destroying them
Also, more importantly- why destroying them?
Code:
count = 0
Gui, Color, FFFFDA
Gui,+AlwaysOnTop -SysMenu
Gui,Font, s50,Verdana
Gui, Add, Text, x75 y75 w220 hwndhTxt, %count%
Gui, Show, h250 w250 , Loop Count %count%
SetTimer, Timer, 50
return

Timer:
  WinSetTitle, Loop Count,, Loop Count %count%
  ControlSetText,, % count,ahk_id %hTxt%
  Count++
return
Back to top
Dazzle
Guest





PostPosted: Wed Sep 17, 2008 2:39 am    Post subject: Reply with quote

Okay here's my real and full code todo this its not finished and not perfect but what it does is scroll a text file for its line every line contains a question.

Why destroying them well I thought this would completly forget the previous or ever created gui in the script.

Code:

SetWorkingDir, %A_ScriptDir%   
Version = 0.0.3

ScriptName =  ver. %Version%

#SingleInstance force
#persistent

#WinActivateForce

#HotkeyInterval 200
#MaxHotkeysPerInterval 2000


Process, priority, , High 
;critical

setbatchlines, -1
setkeydelay, -1
setmousedelay, -1
setcontroldelay, -1
setwindelay, -1
setdefaultmousespeed, 0




;Start of GUI Build

GuiNr := 1
GuiNr:

FileReadLine, OutputVar, %A_ScriptDir%\test.txt, %GuiNr%
    if ErrorLevel
      if GuiNr != 1
         Goto VorigeGuiNr

Gui, %GuiNr%:Color, FFFFDA
Gui, %GuiNr%:+AlwaysOnTop -SysMenu
Gui, %GuiNr%:Font, s7,Verdana
Gui, %GuiNr%:Add, Text, x420 y0, Vraag %GuiNr%
Gui, %GuiNr%:Font, s10,Verdana
Gui, %GuiNr%:Add, GroupBox, x10 y7 h185 w450
Gui, %GuiNr%:Add, Text, x20 y20 , %OutputVar%
Gui, %GuiNr%:Add, Edit, x20 y40 h140 w430 vEditGuiNr
Gui, %GuiNr%:Add, Button, x10 y200 h25 w80 gJaGuiNr, &Ja
Gui, %GuiNr%:Add, Button, x100 y200 h25 w80 gNeeGuiNr, &Nee
Gui, %GuiNr%:Add, Button, x290 y200 h25 w80 gVorigeGuiNr, &Vorige
Gui, %GuiNr%:Add, Button, x380 y200 h25 w80 gVolgendeGuiNr, V&olgende
Gui, %GuiNr%:Show, h235 w470 , CRS Vragen ver. %Version% Vraag %GuiNr%
Return


JaGuiNr:
   Gui, %GuiNr%:Submit, JaHide
   ;SendInput !l!al
   ;SendInput %R1%
   ;SendInput %EditGuiNr%
   Goto VolgendeGuiNr
Return


NeeGuiNr:
   Gui, %GuiNr%:Submit, NeeHide
   ;SendInput %R1%
   ;SendInput %EditGuiNr%
   Goto VolgendeGuiNr
Return


VorigeGuiNr:
   Gui, %GuiNr%:Submit, VorigeHide
   Gui, %GuiNr%:Destroy
      If GuiNr > 1
         GuiNr--
   Goto GuiNr
Return


VolgendeGuiNr:
   Gui, %GuiNr%:Submit, VolgendeHide
   Gui, %GuiNr%:Destroy
      If GuiNr < 99
         GuiNr++
   Goto GuiNr
Return



Exit:
ExitApp

del::reload
home::pause
pgup::edit
end::exitapp


Confused

I really hope someone could understand what I gathered through out the forum too created this script.

Dazzle
Back to top
Dazzle
Guest





PostPosted: Wed Sep 17, 2008 2:43 am    Post subject: Reply with quote

for any testing purpose also create a file named test.txt into the scriptdir wich contains a new question on every line.

Since this is not written in Englisch or Deutsch.
Ja=Yes
Nee=No
Vorige=Previous
Volgende=Next

Thx
Back to top
Mustang



Joined: 17 May 2007
Posts: 421
Location: England

PostPosted: Wed Sep 17, 2008 3:26 am    Post subject: Reply with quote

To create more than 99 Gui's you have to destroy some open one's
Problem solved?
Back to top
View user's profile Send private message
Guest






PostPosted: Wed Sep 17, 2008 5:59 am    Post subject: Reply with quote

Mustang wrote:
To create more than 99 Gui's you have to destroy some open one's
Problem solved?

I think not. Did you read the code in the original post and its title Why does ahk overflow on this gui after gui.nr 99
Code:

loop{

Gui, %A_index%:Color, FFFFDA
Gui, %A_index%:+AlwaysOnTop -SysMenu
Gui, %A_index%:Font, s50,Verdana
Gui, %A_index%:Add, Text, x75 y75, %A_index%

Gui, %A_index%:Show, h250 w250 , Loop Count %A_index%

sleep, 50

Gui, %A_index%:Destroy ; <-------------------
}
And its title
Back to top
Superfraggle



Joined: 02 Nov 2004
Posts: 1019
Location: London, UK

PostPosted: Wed Sep 17, 2008 8:44 am    Post subject: Reply with quote

You can create and destroy as many gui's as you want, you just cannot number them above 99, The script parser doesn't allow gui's to be numbered above 99.
_________________
Steve F AKA Superfraggle

http://r.yuwie.com/superfraggle
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group