Jump to content

Create the Child


Wolvereness
 Share

Recommended Posts

I got a problem with my script, it wont create the child. I'm writing a program so a teacher could enter questions and it randomize questions + answers (each test with it's own answer sheet).

The box IS created, my 'cowspy' picks up a the invisable window

Here is the code I have:

#include <GUIConstants.au3>
Global $x, $wNQ, $wEQ, $wParent, $wEvent
$x = "______________________________________________________________________________________"
If StringRight(@ScriptDir, 14) <> "\TestScrambler" Then
    If Not FileExists(@ScriptDir & "\TestScrambler") Then
        DirCreate(@ScriptDir & "\TestScrambler")
    EndIf
    FileCopy(@ScriptFullPath, @ScriptDir & "\TestScrambler")
    MsgBox(0, "ERROR", "ERROR" & @CRLF & @CRLF & "You do not have this program in its own directory." & @CRLF & "A copy has been placed in the directory TestScrambler withen this directory." & @CRLF & "This program will not run outside of it's own directory.")
    Exit
EndIf
FileInstall("C:\Documents and Settings\Owner\Desktop\AU3 Junk\Included Stuff\Wes.jpg", "Wes.jpg", 1)
FileInstall("C:\Documents and Settings\Owner\Desktop\AU3 Junk\Included Stuff\WesWolf.gif", "WesWolf.gif", 1)
$wParent = GUICreate ("Wesley Wolfe Test Scrambler v1.0 BETA", 523, 600, -1, -1, 0x00200000)
If $wParent = 0 Or GUICtrlCreatePic ("Wes.jpg", 0, 0, 100, 120) = 0 Or GUICtrlCreatePic ("WesWolf.gif", 100, 0, 400, 120) = 0 Or GUICtrlCreateLabel ($x, -2, 120) = 0 Then
    MsgBox(0, "ERROR", "ERROR" & @CRLF & @CRLF & "An Error has occured when creating the dialog box." & @CRLF & "Will now exit.")
    Exit
EndIf
$wNQ = GUICtrlCreateButton ("New Question", 10, 170)
$wEQ = GUICtrlCreateButton ("Edit Question", 85, 170)
GUISetState (@SW_SHOW)
;#cs
While 1
    $wEvent = GUIGetMsg ()
    Select
        Case $wEvent = 0
            ContinueLoop
        Case $wEvent = $wNQ
;        MsgBox(0,"","") <-YES, this does respond
            $wChild1 = GUICreate ("Whate type of question?", 123, 50, -1, -1, 0x40000000, 0x00000008, $wParent)
            If $wChild1 = 0 Then
                MsgBox (0,"ERROR","The window could not be created, now exiting.")
                Exit
            Endif
        ;The creation of buttons and stuff for the question making
        Case $wEvent = $wEQ
        ;The creation of another child for to edit a question
    EndSelect
Wend
;#ce

Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote]

Link to comment
Share on other sites

Nothing... Did I do it right?

#include <GUIConstants.au3>
Global $x, $wNQ, $wEQ, $wParent, $wEvent
$x = "______________________________________________________________________________________"
If StringRight(@ScriptDir, 14) <> "\TestScrambler" Then
    If Not FileExists(@ScriptDir & "\TestScrambler") Then
        DirCreate(@ScriptDir & "\TestScrambler")
    EndIf
    FileCopy(@ScriptFullPath, @ScriptDir & "\TestScrambler")
    MsgBox(0, "ERROR", "ERROR" & @CRLF & @CRLF & "You do not have this program in its own directory." & @CRLF & "A copy has been placed in the directory TestScrambler withen this directory." & @CRLF & "This program will not run outside of it's own directory.")
    Exit
EndIf
FileInstall("C:\Documents and Settings\Owner\Desktop\AU3 Junk\Included Stuff\Wes.jpg", "Wes.jpg", 1)
FileInstall("C:\Documents and Settings\Owner\Desktop\AU3 Junk\Included Stuff\WesWolf.gif", "WesWolf.gif", 1)
$wParent = GUICreate ("Wesley Wolfe Test Scrambler v1.0 BETA", 523, 600, -1, -1, 0x00200000)
If $wParent = 0 Or GUICtrlCreatePic ("Wes.jpg", 0, 0, 100, 120) = 0 Or GUICtrlCreatePic ("WesWolf.gif", 100, 0, 400, 120) = 0 Or GUICtrlCreateLabel ($x, -2, 120) = 0 Then
    MsgBox(0, "ERROR", "ERROR" & @CRLF & @CRLF & "An Error has occured when creating the dialog box." & @CRLF & "Will now exit.")
    Exit
EndIf
$wNQ = GUICtrlCreateButton ("New Question", 10, 170)
$wEQ = GUICtrlCreateButton ("Edit Question", 85, 170)
GUISetState (@SW_SHOW)
;#cs
While 1
    $wEvent = GUIGetMsg ()
    Select
        Case $wEvent = 0
            ContinueLoop
        Case $wEvent = $wNQ
;        MsgBox(0,"","") <-YES, this does respond
            $wChild1 = GUICreate ("Whate type of question?", 123, 50, -1, -1, 0x40000000, 0x00000008, $wParent)
         GuiSwitch($wChild1)
         GUISetState(@SW_SHOW)
            If $wChild1 = 0 Then
                MsgBox (0,"ERROR","The window could not be created, now exiting.")
                Exit
            Endif
        ;The creation of buttons and stuff for the question making
        Case $wEvent = $wEQ
        ;The creation of another child for to edit a question
    EndSelect
Wend
;#ce
Edited by Wolvereness

Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote]

Link to comment
Share on other sites

Ah, your problem is in the window style 0x400000000 ..... which does not contain the WS_VISIBLE Style :idiot:

Try using -1 for style and exstyle or use the styles below

$wChild1 = GUICreate ("Whate type of question?", 123, 50, -1, -1, -1, -1, $wParent)

Typical Window Style is 0x14C00000

WS_OVERLAPPEDWINDOW 00CF0000

WS_OVERLAPPED 00000000

WS_VISIBLE 10000000

WS_CLIPSIBLINGS 04000000

Typical ExStyle is 0x100

WS_EX_WINDOWEDGE 00000100

WS_EX_LEFT 00000000

WS_EX_LTRREADING 00000000

WS_EX_RIGHTSCROLLBAR 00000000

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

BINGO, thanks dude...

I thought you HAD to have that for a child window...

Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote]

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