Sign in to follow this  
Followers 0
lyonrt

GUI problem launching seperate GUI window

2 posts in this topic

I am trying to have a large window automatically come up on top of my current gui that I have coded below. Basically I am trying to have a form pop up in front of the gui so the user is forced to register via the form before using the application.

Here is my code:

#include <GuiConstants.au3>
#include <inet.au3>


GuiCreate("ResNet CD", 285, 680)
MsgBox(0,"How To Get Certified","Follow Each Step Carefully" & @LF & "Once You Are Done, Please Click Certify Me At The Bottom Of The Screen")


;************************************MENU*******************************************
$filemenu = GuiCtrlCreateMenu("File")
$separator1 = GuiCtrlCreateMenuitem ("", $filemenu)
$fileitem = GuiCtrlCreateMenuitem ("Exit",$filemenu)

GuiCtrlCreateMenu("Options")

$applicationmenu = GuiCtrlCreateMenu("Apps")
$app1= GuiCtrlCreateMenuitem ("Stinger", $applicationmenu)
$app2= GuiCtrlCreateMenuitem ("AVG", $applicationmenu)
$app7= GuiCtrlCreateMenuitem ("ClamAV", $applicationmenu)

$separator2 = GuiCtrlCreateMenuitem ("", $applicationmenu)

$app3= GuiCtrlCreateMenuitem ("Spybot", $applicationmenu)
$app4= GuiCtrlCreateMenuitem ("Adaware", $applicationmenu)

$separator3 = GuiCtrlCreateMenuitem ("", $applicationmenu)

$app5= GuiCtrlCreateMenuitem ("Service Pk. 2", $applicationmenu)
$app6= GuiCtrlCreateMenuitem ("Firefox", $applicationmenu)

$helpmenu = GuiCtrlCreateMenu("Help")
$helpitem = GuiCtrlCreateMenuitem ("About",$helpmenu)

;************************************LABEL TOP****************************************
$Label = GUICtrlCreateLabel("Choose from the items below.",10,10)





;************************************ANTIVIRUS GROUP***********************************
GuiCtrlCreateGroup("Step 1 - Remove Virus(s)", 10, 30,260,80)
$STINGER = GUICtrlCreateButton("Run Stinger", 30, 50, 100, 50)
$AVG = GUICtrlCreateButton("Install AVG", 150, 50, 100, 50)
GUICtrlCreateGroup ("",-99,-99,1,1) ;close group




;************************************SPYWARE GROUP***********************************

GuiCtrlCreateGroup("Step 2 - Remove Spyware & Datamine(s)", 10, 125,260,100)
$SPYBOT = GUICtrlCreateButton("SpyBot Update or Install", 70,155,130,50)
GUICtrlCreateGroup ("",-99,-99,1,1) ;close group




;************************************WINDOWS UPDATE*****************************************

GuiCtrlCreateGroup("Step 3 - Windows Update", 10, 240,260,70)
$www = GUICtrlCreateLabel ("www.windowsupdate.com",30,270,140,15)
GuiCtrlSetColor($www,0x0000ff)
GuiCtrlSetCursor($www,0)
GUICtrlCreateGroup ("",-99,-99,1,1) ;close group


;************************************Right Student Drive Mapper*************************************************************
GuiCtrlCreateGroup("Step 4 - Map To Your Student Drive", 10, 320,260,110)

$Labellogin = GUICtrlCreateLabel("Username:",30,350)
$inputlogin= GUICtrlCreateInput("",90,348,90,20)

$Labelpass = GUICtrlCreateLabel("Password:",30,380)
$inputpass = GUICtrlCreateInput("",90,378,90,20,$ES_PASSWORD)

$MapDrive = GUICtrlCreateButton("Map Drive", 30,400,60,25)


GUICtrlCreateGroup ("",-99,-99,1,1) ;close group


;************************************SYSTEM INFO*****************************************
; GROUP: INPUT IP,ComputerName, MAC

GuiCtrlCreateGroup("Step 5 - Submit For Certification", 10, 445,260,100)

$LabelIP = GUICtrlCreateLabel("IP: " , 20, 480)
$PublicIP = @IPAddress1
GuiCtrlCreateInput(@IPAddress1, 70, 478, 150, 20)

$PublicNAME = @ComputerName

$LabelName = GUICtrlCreateLabel("Computer: ",20,510)
$PublicNAME = @ComputerName
GUICtrlCreateInput(@ComputerName,70,508,150,20)


$Certify= GUICtrlCreateButton("Certify Me", 40,560,200,60)

GUICtrlCreateGroup ("",-99,-99,1,1) ;close group




;************************************FOOTER*********************************************************

****
$Labelfooter = GUICtrlCreateLabel("Created ByTyler Lyon (c)2006  All Rights Reserved.",10,630)




GUISetState() ; display the GUI

Do
    $msg = GUIGetMsg()
   
    Select
;************************************ABOUT BOX*************************************************************
;File Menu Below        
        Case $msg = $helpitem
            Msgbox(0,"About","Robert Tyler Lyon")

;************************************MENU FUNCTIONS*************************************************************
        
        Case $msg= $fileitem
            Exit
        Case $msg= $app1
            Run("stinger_run.exe")
        Case $msg= $app2
            Run("avg71free_375a691.exe")
        Case $msg= $app3
            Run("Spybot_Install_or_run.exe")
        Case $msg= $app4
            Run("aawsepersonal.exe")
        Case $msg= $app5
            Run("WindowsXP-KB835935-SP2-ENU.exe")
        Case $msg= $app6
            Run("Firefox Setup 1.5.exe")
        Case $msg= $app7
            Run("clamwin-0.83-setup.exe"

;************************************BUTTON FUNCTIONS*************************************************************

        Case $msg= $AVG
             Run("avg71free_375a691.exe")
        Case $msg= $STINGER
            Run("stinger_run.exe")
        Case $msg= $SPYBOT
            Run("Spybot_Install_or_run.exe")
                
        Case $msg= $www
            Run(@ComSpec & " /c " & 'start  www.windowsupdate.com', "", @SW_HIDE)
        
        Case$msg = $MapDrive

            $username = GuiCtrlRead($inputlogin)
        ; Remove domain from username if user included it
                If StringLeft($username,3) = "bc\" Then $username= StringTrimLeft($username, 3)
                $password = GuiCtrlRead($inputpass)

; Map X drive to \\phoenix\username$ using current user
DriveMapAdd("X:", "\\phoenix\$username" & "$", "bc\" & $username,$password)


Case Else


        
        Case $msg= $GUI_EVENT_CLOSE


            
    EndSelect
Until $msg = $GUI_EVENT_CLOSE

-Thanks,

Tyler

Share this post


Link to post
Share on other sites



maybe like this

#include <GuiConstants.au3>
#include <inet.au3>
;********Sign In *******
GuiCreate("ResNet CD", 285, 280)
MsgBox(0,"How To Get Certified","Follow Each Step Carefully" & @LF & "First you need to Sign In  ")

;************************************SYSTEM INFO*****************************************
; GROUP: INPUT IP,ComputerName, MAC

GuiCtrlCreateGroup("Step 1 - Sign In For Certification", 10, 45,260,100)

$LabelS = GUICtrlCreateLabel("Name: " , 20, 80)

$name = GuiCtrlCreateInput("", 70, 78, 150, 20)

$LabelPass = GUICtrlCreateLabel("Password: ",20,110)

$pass = GUICtrlCreateInput("Password",70,108,150,20)


$Check= GUICtrlCreateButton("Sign In", 40,160,200,60)

GUICtrlCreateGroup ("",-99,-99,1,1);close group
GUISetState(); display the GUI

While 1
    $msg = GUIGetMsg()
  
    Select
        
        Case $msg= $Check
            If GUICtrlRead($pass) = "Password" Then
            ;verify or write password to a file
                GUIDelete()
                ExitLoop
            EndIf
        Case $msg= $GUI_EVENT_CLOSE
            Exit
            
    EndSelect
WEnd 

; ******************************** FULL MENU ***********************

GuiCreate("ResNet CD", 285, 680)
MsgBox(0,"How To Get Certified","Follow Each Step Carefully" & @LF & "Once You Are Done, Please Click Certify Me At The Bottom Of The Screen")


;************************************MENU*******************************************
$filemenu = GuiCtrlCreateMenu("File")
$separator1 = GuiCtrlCreateMenuitem ("", $filemenu)
$fileitem = GuiCtrlCreateMenuitem ("Exit",$filemenu)

GuiCtrlCreateMenu("Options")

$applicationmenu = GuiCtrlCreateMenu("Apps")
$app1= GuiCtrlCreateMenuitem ("Stinger", $applicationmenu)
$app2= GuiCtrlCreateMenuitem ("AVG", $applicationmenu)
$app7= GuiCtrlCreateMenuitem ("ClamAV", $applicationmenu)

$separator2 = GuiCtrlCreateMenuitem ("", $applicationmenu)

$app3= GuiCtrlCreateMenuitem ("Spybot", $applicationmenu)
$app4= GuiCtrlCreateMenuitem ("Adaware", $applicationmenu)

$separator3 = GuiCtrlCreateMenuitem ("", $applicationmenu)

$app5= GuiCtrlCreateMenuitem ("Service Pk. 2", $applicationmenu)
$app6= GuiCtrlCreateMenuitem ("Firefox", $applicationmenu)

$helpmenu = GuiCtrlCreateMenu("Help")
$helpitem = GuiCtrlCreateMenuitem ("About",$helpmenu)

;************************************LABEL TOP****************************************
$Label = GUICtrlCreateLabel("Choose from the items below.",10,10)





;************************************ANTIVIRUS GROUP***********************************
GuiCtrlCreateGroup("Step 1 - Remove Virus(s)", 10, 30,260,80)
$STINGER = GUICtrlCreateButton("Run Stinger", 30, 50, 100, 50)
$AVG = GUICtrlCreateButton("Install AVG", 150, 50, 100, 50)
GUICtrlCreateGroup ("",-99,-99,1,1);close group




;************************************SPYWARE GROUP***********************************

GuiCtrlCreateGroup("Step 2 - Remove Spyware & Datamine(s)", 10, 125,260,100)
$SPYBOT = GUICtrlCreateButton("SpyBot Update or Install", 70,155,130,50)
GUICtrlCreateGroup ("",-99,-99,1,1);close group




;************************************WINDOWS UPDATE*****************************************

GuiCtrlCreateGroup("Step 3 - Windows Update", 10, 240,260,70)
$www = GUICtrlCreateLabel ("www.windowsupdate.com",30,270,140,15)
GuiCtrlSetColor($www,0x0000ff)
GuiCtrlSetCursor($www,0)
GUICtrlCreateGroup ("",-99,-99,1,1);close group


;************************************Right Student Drive Mapper*************************************************************
GuiCtrlCreateGroup("Step 4 - Map To Your Student Drive", 10, 320,260,110)

$Labellogin = GUICtrlCreateLabel("Username:",30,350)
$inputlogin= GUICtrlCreateInput("",90,348,90,20)

$Labelpass = GUICtrlCreateLabel("Password:",30,380)
$inputpass = GUICtrlCreateInput("",90,378,90,20,$ES_PASSWORD)

$MapDrive = GUICtrlCreateButton("Map Drive", 30,400,60,25)


GUICtrlCreateGroup ("",-99,-99,1,1);close group


;************************************SYSTEM INFO*****************************************
; GROUP: INPUT IP,ComputerName, MAC

GuiCtrlCreateGroup("Step 5 - Submit For Certification", 10, 445,260,100)

$LabelIP = GUICtrlCreateLabel("IP: " , 20, 480)
$PublicIP = @IPAddress1
GuiCtrlCreateInput(@IPAddress1, 70, 478, 150, 20)

$PublicNAME = @ComputerName

$LabelName = GUICtrlCreateLabel("Computer: ",20,510)
$PublicNAME = @ComputerName
GUICtrlCreateInput(@ComputerName,70,508,150,20)


$Certify= GUICtrlCreateButton("Certify Me", 40,560,200,60)

GUICtrlCreateGroup ("",-99,-99,1,1);close group




;************************************FOOTER*********************************************************



$Labelfooter = GUICtrlCreateLabel("Created ByTyler Lyon (c)2006  All Rights Reserved.",10,630)




GUISetState(); display the GUI

Do
    $msg = GUIGetMsg()
  
    Select
;************************************ABOUT BOX*************************************************************
;File Menu Below        
        Case $msg = $helpitem
            Msgbox(0,"About","Robert Tyler Lyon")

;************************************MENU FUNCTIONS*************************************************************
        
        Case $msg= $fileitem
            Exit
        Case $msg= $app1
            Run("stinger_run.exe")
        Case $msg= $app2
            Run("avg71free_375a691.exe")
        Case $msg= $app3
            Run("Spybot_Install_or_run.exe")
        Case $msg= $app4
            Run("aawsepersonal.exe")
        Case $msg= $app5
            Run("WindowsXP-KB835935-SP2-ENU.exe")
        Case $msg= $app6
            Run("Firefox Setup 1.5.exe")
        Case $msg= $app7
            Run("clamwin-0.83-setup.exe"

;************************************BUTTON FUNCTIONS*************************************************************

        Case $msg= $AVG
             Run("avg71free_375a691.exe")
        Case $msg= $STINGER
            Run("stinger_run.exe")
        Case $msg= $SPYBOT
            Run("Spybot_Install_or_run.exe")
                
        Case $msg= $www
            Run(@ComSpec & " /c " & 'start   www.windowsupdate.com', "", @SW_HIDE)
        
        Case$msg = $MapDrive

            $username = GuiCtrlRead($inputlogin)
       ; Remove domain from username if user included it
                If StringLeft($username,3) = "bc\" Then $username= StringTrimLeft($username, 3)
                $password = GuiCtrlRead($inputpass)

; Map X drive to \\phoenix\username$ using current user
;DriveMapAdd("X:", "\\phoenix\$username" & "$", "bc\" & $username,$password)


Case Else


        
        Case $msg= $GUI_EVENT_CLOSE


            
    EndSelect
Until $msg = $GUI_EVENT_CLOSE

8)


NEWHeader1.png

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