Jump to content

How many child windows can you have?


Recommended Posts

I have my main window which is full screen. Then I have several items you can select from a menu and they each open up a smaller window. I set each one to be a child window of $main_window but it seems to only let me open one at a time whereas I can't keep more than one smaller window open at the same time. I'm trying to setup 1 window to show realtime data and another for data input

Is there a limit to the number of child windows you can have on your screen at once?? The child window example in the helpfile only shows one child window, which I would expect it to to keep it simple. Are there any examples anywhere that have several, say 3 or 4, windows open?

Edited by Marklar
Link to comment
Share on other sites

http://dundats.mvps.org/autoit/html/faq.htm#15

Look at technical limitations in the Help File under FAQs

#)

edit: Maximum number of GUI windows: 1024

Edited by nfwu
Link to comment
Share on other sites

okay... you know of any scripts that show a gui with more than 1 child window open at the same time?

here's my main window code

$main_window = GUICreate($title,(@DesktopWidth-100),(@DesktopHeight-100),-1,-1,$WS_MAXIMIZE + $WS_MAXIMIZEBOX + $WS_MINIMIZEBOX)

then it checks for the menu click

GUISetState()
While 1
    $msg = GUIGetMsg()

    Select
    case $msg = $GUI_EVENT_CLOSE or $msg = $exititem
        GUIDelete($main_window)
        Exit
    case $msg = $prioritylist
        priority_window()
    case $msg = $viewstatusitem
        board()
    case $msg = $neworder
        new_order()
    EndSelect
WEnd

the begginning of the board function

func board()
dim $order_num, $truck, $shipper, $receiver
dim $order[5]
dim $list[40]
$dispatch_board = GuiCreate("Dispatch Board",1018,618,1,51,-1,$WS_EX_MDICHILD,$main_window)
$orders_list = GUICtrlCreateListView ("Order|Truck|Shipper|Destination|Status",10,10,(@DesktopWidth-250),400)
$i = 1
_GUICtrlListViewSetColumnWidth ($orders_list, 0, 80)
_GUICtrlListViewSetColumnWidth ($orders_list, 1, 80)
_GUICtrlListViewSetColumnWidth ($orders_list, 2, 250)
_GUICtrlListViewSetColumnWidth ($orders_list, 3, 250)

Then the priority window (which after it's closed will not come up again for some reason until you restart the script

func priority_window()
    $priority_window = GUICreate("Priority List",550,180,1,51,-1,$WS_EX_MDICHILD,$main_window)

Both will not open at the same time. Only one at a time.

Link to comment
Share on other sites

Another sample that might give you some ideas:

#include <GUIConstants.au3>

HotKeySet("{ESC}", "MyExit")
Local $MAX = 5
local $guis[$MAX + 1]
for $i = 1 to $MAX
   $guis[$i] = GUICreate("GUI: " & $i, 150, 100, $i*150, $i*100)
   GUISetState(@SW_SHOW)
Next 
Local $msg = GUIGetMsg(1) ;NOTE: Read the help file on GUIGetMsg
While $msg[0] <> -3
   $msg = GUIGetMsg(1)
   Switch $msg[0]
      case 0
         sleep(100)
      case -11
      case else 
         ConsoleWrite("Control or event ID:=" & $msg[0] & ", hwnd:=" & $msg[1] & @LF)
   EndSwitch
WEnd 
Func MyExit()
   exit
EndFunc 
Exit
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...