Sign in to follow this  
Followers 0
Hooch

Child Window Examples?

7 posts in this topic

Hey all,

I spent the day converting my script (couple thousand lines w/ 100+ controls) to 103. The conversion went smoothly thanks to that great script CyberSlug wrote however I am having problems.

As multiple GUI's were not supported in 102 I just made a seperate exe for my "child" window. My problem is in trying to move to a proper parent child setup.

I have both windows coming up independently of each other but my buttons are not reporting, even my tabs don't work. They switch but the controls on each tab dont display, only the controls that are on the primary tab.

So I am hoping for an example script I can look at and maybe find my way again.

Share this post


Link to post
Share on other sites



Hey all,

I spent the day converting my script (couple thousand lines w/ 100+ controls) to 103. The conversion went smoothly thanks to that great script CyberSlug wrote however I am having problems.

As multiple GUI's were not supported in 102 I just made a seperate exe for my "child" window. My problem is in trying to move to a proper parent child setup.

I have both windows coming up independently of each other but my buttons are not reporting, even my tabs don't work. They switch but the controls on each tab dont display, only the controls that are on the primary tab.

So I am hoping for an example script I can look at and maybe find my way again.

<{POST_SNAPBACK}>

:) no love...

Share this post


Link to post
Share on other sites

:) no love...

<{POST_SNAPBACK}>

just post sample of your script so we can help :)

Share this post


Link to post
Share on other sites

Here's an example:

#include <GUIConstants.au3>
AutoItSetOption("TrayIconDebug", 1)
AutoItSetOption("WinTitleMatchMode", 4)

;Initialize variables
Global $style1
Global $IniFile
Global $GUIWidth
Global $GUIHeight

$GUIWidth = 250
$GUIHeight = 250
$IniFile = StringTrimRight(@ScriptFullPath, 3) & "ini"

;Only a close button:
;$style1 = BitOR($WS_POPUP, $WS_CAPTION, $WS_SYSMENU)
;GUICreate("New GUI", $GUIWidth, $GUIHeight, -1, -1, $style1)

$ParentWin = GUICreate("Parent GUI", $GUIWidth, $GUIHeight)
$ParentWin_Pos = WinGetPos("handle=" & $ParentWin, "")

$ChildWin = GUICreate("Child GUI", $GUIWidth, $GUIHeight, $ParentWin_Pos[0] + 100, $ParentWin_Pos[1] + 100, -1, -1, $ParentWin)
GUISetState(@SW_SHOW)

GUISwitch($ParentWin)
GUISetState(@SW_SHOW)

While 1
   Sleep(25)
   $msg = GUIGetMsg(1)
   Select
   
      Case $msg[0] = $GUI_EVENT_CLOSE
         If $msg[1] = $ParentWin Then
            MsgBox(64, "Test", "Parent GUI will now close.")
            GUISwitch($ParentWin)
            GUIDelete()
            Exit
         ElseIf $msg[1] = $ChildWin Then
            MsgBox(64, "Test", "Child GUI will now close.")
            GUISwitch($ChildWin)
            GUIDelete()
         EndIf

     ;Case $msg = ...

   EndSelect

WEnd

Share this post


Link to post
Share on other sites

This was a string I started to Try and Get support for makeing a Child Window have a working scroll bar. It seams that feature is not yet implimented, but it shows you an example of a child window. Let me know if you have any questions.

Just note that a "Child Window's Location is based on the parent window not the page location.

My Webpage

Share this post


Link to post
Share on other sites

Ahhh thanks a million guys, that was the kind of examples I needed, I now have it working! As well I knocked a 100kb off the program not having to compile a seperate exe ! Yay!

Anyways thanks again, 103 is very nice....

Share this post


Link to post
Share on other sites

just post sample of your script so we can help :)

<{POST_SNAPBACK}>

I didn't see your message there jp, I didn't post my script because it is a little complicated with lots of includes and conditionals so posting it would have created more confusion. :)

Luckily the examples posted helped me out, I wasn't aware of the whole GUIswitch thing so my windows were displaying but not posting and events.

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