Sign in to follow this  
Followers 0

Maximum amount of GUI's in a script?

23 posts in this topic

Posted

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

Share this post


Link to post
Share on other sites



Posted

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

It's quite simple...

Share this post


Link to post
Share on other sites

Posted

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")

Share this post


Link to post
Share on other sites

Posted

should have used a for...next loop to make all those gui's :">

Share this post


Link to post
Share on other sites

Posted

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

Share this post


Link to post
Share on other sites

Posted

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)

Share this post


Link to post
Share on other sites

Posted

Anyone who can agree or disagree?...

Share this post


Link to post
Share on other sites

Posted

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 :)

Share this post


Link to post
Share on other sites

Posted

who needs 16 hideded windows!!!

I do, when making large programs with ALOT of buttons in different treeviewitems...

IS this a limit?

Share this post


Link to post
Share on other sites

Posted (edited)

i get to like 120-130 guis before it hangs (goes really really slow)

but yes the button works the same here ... (not :) )

Edited by w0uter

Share this post


Link to post
Share on other sites

Posted

i get to like 120-130 guis before it hangs (goes really really slow)

but yes the button works the same here ... (not  :D )

<{POST_SNAPBACK}>

hmm wierd.. :)

Share this post


Link to post
Share on other sites

Posted

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?

Share this post


Link to post
Share on other sites

Posted (edited)

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

Share this post


Link to post
Share on other sites

Posted

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

Share this post


Link to post
Share on other sites

Posted

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...

Share this post


Link to post
Share on other sites

Posted (edited)

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

Share this post


Link to post
Share on other sites

Posted (edited)

Do you need to use extended "guigetMsg" as in recent posts?;

Toggle GUI

Close GUI?

Randall

Edited by randallc

Share this post


Link to post
Share on other sites

Posted

Neither of those work.

Share this post


Link to post
Share on other sites

Posted

Neither of those work.

<{POST_SNAPBACK}>

I see - fascinating - not that i'd know! - Will you report it somewhere? - personal mail?

Randall

Share this post


Link to post
Share on other sites

Posted

THanks Wb_freeKill and herewasplato :D

I found the BUG. I am not sure the correction will not break something else. :)

So please everybody check with 3.1.1.12 (not yet uploaded)

Share this post


Link to post
Share on other sites

Posted

THanks Wb_freeKill and herewasplato :D

I found the BUG. I am not sure the correction will not break something else. :D

So please everybody check with 3.1.1.12 (not yet uploaded)

<{POST_SNAPBACK}>

Ahh GREAT! :huh:

So it should be possible to create more than 16 working gui's in this version?

When and were can i get it?

Thanks again, great job! :)

Share this post


Link to post
Share on other sites

Posted

Ahh GREAT!  :D 

So it should be possible to create more than 16 working gui's in this version?

When and were can i get it?

Thanks again, great job! :)

<{POST_SNAPBACK}>

perhaps tonight I have only this fix to upload I am usually waiting the end of the day to upload.

Share this post


Link to post
Share on other sites

Posted

perhaps tonight I have only this fix to upload I am usually waiting the end of the day to upload.

<{POST_SNAPBACK}>

Great! but were can i download it then? im not that fast about updates :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0