Jump to content

Maximum amount of GUI's in a script?


Recommended Posts

Just noticed, when you have more than 16 GUI's in a script, hided or not.. if you have a button in one of these gui's, it wont be "cought" by the GUIGetMsg() if pressed :)

Is there a limit of how many GUI's in a script?

Example:

#Include <GUIConstants.au3>

GUICreate("1",200,200)
GUISetState(@SW_HIDE)

GUICreate("2",200,200)
GUISetState(@SW_HIDE)

GUICreate("3",200,200)
GUISetState(@SW_HIDE)

GUICreate("4",200,200)
GUISetState(@SW_HIDE)

GUICreate("5",200,200)
GUISetState(@SW_HIDE)

GUICreate("6",200,200)
GUISetState(@SW_HIDE)

GUICreate("7",200,200)
GUISetState(@SW_HIDE)

GUICreate("8",200,200)
GUISetState(@SW_HIDE)

GUICreate("9",200,200)
GUISetState(@SW_HIDE)

GUICreate("10",200,200)
GUISetState(@SW_HIDE)

GUICreate("11",200,200)
GUISetState(@SW_HIDE)

GUICreate("12",200,200)
GUISetState(@SW_HIDE)

GUICreate("13",200,200)
GUISetState(@SW_HIDE)

GUICreate("14",200,200)
GUISetState(@SW_HIDE)

GUICreate("15",200,200)
GUISetState(@SW_HIDE)

#CS
GUICreate("16",200,200); Test GUI, try activate.. and then press button
GUISetState(@SW_HIDE)   
#CE

GUICreate("My GUI",300,330)
$Button = GUIctrlcreatebutton("Push me",115,290,70,22)
GUISetState(@SW_SHOW)

While 1
$msg = GUIGetMsg()

    If $msg =$GUI_EVENT_CLOSE Then Exit
 
    If $msg = $Button Then msgbox(0,"","test")
        
WEnd
Link to comment
Share on other sites

Works for me using http://www.autoitscript.com/fileman/users/jpm/AutoIt3-gui/...

What happens when you run the following?: I get up to 99 on the tooltip, but then the script hangs....

#include <GuiConstants.au3>

$count = 0
While 1
    sleep(10)
    $result = GuiCreate("GUI Number " & $count, 200, 200)
    If @error Then ExitLoop
    $count = $count + 1
    ToolTip("Creating GUI Window " & $count, 0, 0)
WEnd
    
MsgBox(4096,"Information", "Created " & $count & " GUI windows")
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

I got about 150 before the script started to hang, All of this probably just depends on the computer your using.

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

Works for me using AutoIt 3.1.1.8 on Windows XP SP2...

But did you tri the button, when more than 16 GUI's are created... testet in on several of my scripts, and i didn't work.. i counted the gui's and i was the same amount every time :D

I got about 150 before the script started to hang, All of this probably just depends on the computer your using.

It's not about how many GUI's you can create, but if the buttons in them works..

At my example, if i activate the 17'th GUI, the button wont respond at all.. but if i deactivate the 17'th it work again :)

And i don't think is my pc!

AMD 64 3200+ @ 2400 MHz

1 GB RAM

Sapphire X800 Pro

Raptor 74 Gb (bootdisk)

Link to comment
Share on other sites

Well I get just the same 'looks like a bug' on my au3 system on XP Rev. 1 - I tried the script in different conditions and it do blocks the messages from the attached control some how but it's a wird script, who needs 16 hideded windows!!!

KÃ¥re :)

Link to comment
Share on other sites

another test (100 works for me)

main()
Func main()
    ToolTip ( "Waiting for user interaction", 0, 0, "Script Status" )
    $n = InputBox ( "AutoIt V3 Test", "Type the number of GUIs to create", 100 )
    If $n = "" Then Exit
    ToolTip ( "Creating GUIs", 0, 0, "Script Status" )
    For $n = 0 To $n-1
        GUICreate ( "Hidden window", 1, 1 )
    Next
    GUICreate ( "Shown Window", 100, 25 )
    ToolTip ( "Displaying GUI", 0, 0, "Script Status" )
    $button = GUICtrlCreateButton ( "Push me", 0, 0, 100, 25 )
    GUISetState ( )
    ToolTip ( "Waiting for user interaction", 0, 0, "Script Status" )
    Do 
        Sleep ( 10 )
    Until GUIGetMsg ( ) = $button
    ToolTip ( "Disabling button", 0, 0, "Script Status" )
    GUICtrlSetState ( $button, 128 )
    ToolTip ( "Waiting for user interaction", 0, 0, "Script Status" )
    Do
        Sleep ( 10 )
    Until GUIGetMsg ( ) = -3
    ToolTip ( "Waiting for user interaction", 0, 0, "Script Status" )
    $msgbox = MsgBox ( 32 + 4, "AutoIt V3 Test", "Would you like to test AutoIt V3 again?" )
    ToolTip ( "Exiting", 0, 0, "Script Status" )
    If $msgbox = 6 Then _
        main()
EndFunc
Exit

i just tried 200 and that worked too

whats the highest you guys get?

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

Hmm, when i run the program, it gives me an error about the tooltip, so i removed "Script Status" from it..

When i run the program after removeing it, it gives me that input, i set it to 100 gui's.. the "show window" GUI shows, and when pressing the button, it bacomes disabled.. and then nothing happens at all :)

Edit: But what should this prove?

Edited by Wb-FreeKill
Link to comment
Share on other sites

It proves that we can have many guis and still have them work

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

Uhmm, anyone who tried and have the same problem?  :)

It's quite simple...

<{POST_SNAPBACK}>

I changed your code ever so slightly:
#Include <GUIConstants.au3>
For $i = 1 to 16
    GUICreate($i,400,400)
    GUISetState(@SW_SHOW)
Next

GUICreate("My GUI",300,330)
$Button = GUIctrlcreatebutton("Push me",115,290,70,22)
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    If $msg =$GUI_EVENT_CLOSE Then Exit
    If $msg = $Button Then msgbox(0,"","test")
WEnd

Ran this on two systems - both work at 15 and stop working at 16 loops...

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Sorry, i messed up when i made my code. Here is the fixed version that also shows the bug of windows not working when you get to 16 guis

ToolTip ( "Waiting for user interaction", 0, 0, "Script Status" )
$num = InputBox ( "AutoIt V3 Test", "Type the number of GUIs to create", 15 )
If $num = "" Then Exit
ToolTip ( "Creating GUIs", 0, 0, "Script Status" )
For $n = 0 To $num-1
    GUICreate ( "Hidden Window", 1, 1 )
Next
$gui = GUICreate ( "Shown Window", 100, 25 )
ToolTip ( "Displaying GUI", 0, 0, "Script Status" )
$button = GUICtrlCreateButton ( "Push me", 0, 0, 100, 25 )
GUISetState ( )
GuiSwitch ( $gui )
ToolTip ( "Waiting for user interaction", 0, 0, "Script Status" )
Do
    $msg_array = GUIGetMsg(1)
    $msg = $msg_array[0] 
Until $msg = $button
ToolTip ( "Disabling button", 0, 0, "Script Status" )
GUICtrlSetState ( $button, 128 )
ToolTip ( "Waiting for user interaction", 0, 0, "Script Status" )
Do
    $msg_array = GUIGetMsg(1)
    $msg = $msg_array[0] 
Until $msg = -3

Edit: And a version for 3.1.0 users:

ToolTip ( "Waiting for user interaction", 0, 0 )
$num = InputBox ( "AutoIt V3 Test", "Type the number of GUIs to create", 15 )
If $num = "" Then Exit
ToolTip ( "Creating GUIs", 0, 0 )
For $n = 0 To $num-1
    GUICreate ( "Hidden Window", 1, 1 )
Next
$gui = GUICreate ( "Shown Window", 100, 25 )
ToolTip ( "Displaying GUI", 0, 0 )
$button = GUICtrlCreateButton ( "Push me", 0, 0, 100, 25 )
GUISetState ( )
GuiSwitch ( $gui )
ToolTip ( "Waiting for user interaction", 0, 0 )
Do
    $msg_array = GUIGetMsg(1)
    $msg = $msg_array[0] 
Until $msg = $button
ToolTip ( "Disabling button", 0, 0 )
GUICtrlSetState ( $button, 128 )
ToolTip ( "Waiting for user interaction", 0, 0 )
Do
    $msg_array = GUIGetMsg(1)
    $msg = $msg_array[0] 
Until $msg = -3

Edit: When i create 16 GUIs with this code the button does not work. But when i create 16 with the originally posted code it works. The code herewasplato posted didn't work.

Edit: Modified code.

Edit: GUI Switch does NOT fix the bug.

Edit: Modified code.

Edit: Extended GUI msg does NOT fix the bug.

Edited by Xenogis

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

Neither of those work.

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...