Jump to content

GuiCreate - Help with parent/child behavior


ken82m
 Share

Recommended Posts

When I set $Win1 as the parent for the MsgBox I am unable to interact with $Win1 while the MsgBox is open.

How can I make Win2 behave like the MsgBox?

I've tried numerous style/extended style cobinations and had no luck.

But no matter what I do I'm still able to interact with $Win1.

Thanks,

Kenny

Here's some sample code:

#include <GUIConstantsEx.au3>

$Win1 = GUICreate("Win1", 400, 200)
$Exit = GUICtrlCreateButton("Exit", 0, 0, 100, 25)
$Btn1 = GUICtrlCreateButton("Open Win2", 200, 100, 100, 25)
$Win2 = GUICreate("Win2", 100, 100, -1, -1, -1, -1, $Win1)
GUISetState(@SW_SHOW, $Win1)

MsgBox(0,"","Child", 0, $Win1)

While 1
    $nMsg = GUIGetMsg(1)
    $nMsgWindows = $nMsg[1]
    $nMsg = $nMsg[0]
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            If $nMsgWindows = $Win1 Then Exit
            If $nMsgWindows = $Win2 Then GUISetState(@SW_HIDE, $Win2)
        Case $Exit
            Exit
        Case $Btn1
            GUISetState(@SW_SHOW, $Win2)
    EndSwitch
WEnd

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

ah ok cool, works fine.

I tried that a while back and whenever I re-enabled the parent it would cause the whole window to flash while being repainted.

I guess it was just a bug with whatever rev I was running at the time.

Thanks,

Kenny

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

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