Jump to content
Sign in to follow this  
Syed23

Need Help on getting control of parent GUI from Child GUI

Recommended Posts

Syed23

Hi Friends,

I have created one parent GUI whcih will have all the details of my operating system and some buttons. Also on the top of my GUI i have the MEnu item help. Inside the menuitem i have 2 options one is About and Help. If i click on About that will create another child GUI.

Now the thing is once i click on OK from the Child GUI window the parent GUI should get the control but where i couldn't do. For that i am using deleting both parent and child GUI and recreating the parent GUI. I know there might some other way to do but i m failing to get that. Can some one help me on that? Reference code i have attached below.

Thanks in advance!

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
Global $font = "Times New Roman" 
Global $Title = "GUITest", $GUIGD 
form1() 
;********************************************************************************************************************************************************************* 
;GUI creation starts here 
;*********************************************************************************************************************************************************************;********************************************************************************************************************************************************************* 
Func form1() 
;GUI Creation part 
;Sleep(2500) 
$GUIGD = GUICreate("Core Application Checker", 800, 600) 

Global $help = GUICtrlCreateMenu("Help") 
Global $fileitem = GUICtrlCreateMenuItem("Help", $help) 
Global $fileitem1 = GUICtrlCreateMenuItem("About", $help) 
;Tab with User name 
;GuiCtrlCreateTab(620, 0, 150, 40) 
GUISetFont(12.2, 400, $font) 
;GuiCtrlCreateTabItem("Script user") 
GUICtrlSetFont(-1, 9, 400, 4, $font) 
GUICtrlCreateLabel("User Name: ", 400, 40) 
Global $nameinput = GUICtrlCreateInput("", 570, 40, 200) 
GUICtrlSetState($nameinput, $GUI_DISABLE) 
GUICtrlCreateLabel("Windows Language: ", 400, 5) 

;Operating System Group With Radio Buttons 
GUICtrlCreateGroup("Operating System Group", 20, 170, 240, 340) 
$WindowsXP = GUICtrlCreateRadio("Windows XP", 40, 210) ;Checkbox Standard Install 
;_GUICtrlButton_SetFocus($WindowsXP) 
$WindowsVISTA = GUICtrlCreateRadio("Windows VISTA", 40, 270) ;Checkbox Experimental Lab 
;_GUICtrlButton_SetFocus($WindowsVISTA) 
$Windows7 = GUICtrlCreateRadio("Windows7 64 Bit", 40, 330) ;Checkbox Restart 
;_GUICtrlButton_SetFocus($Windows7) 
$Windows732 = GUICtrlCreateRadio("Windows7 32 Bit", 40, 400) 
;GUICtrlSetState($Windows7,$GUI_UNCHECKED) 
GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group 
;Platform System group with Radio Buttons 

;Button 
$submit = GUICtrlCreateButton("Check", 60, 530, 100, 30) 
$clear = GUICtrlCreateButton("Clear", 310, 530, 100, 30) 
$exit = GUICtrlCreateButton("Exit", 580, 530, 100, 30) 
GUICtrlSetTip($WindowsXP, "Option for selection Windows XP Operating System.") 
GUICtrlSetTip($WindowsVISTA, "Option for selection Windows VISTA Operating System.") 
GUICtrlSetTip($Windows7, "Option for selection Windows 7 Operating System.") 
GUICtrlSetTip($Windows732, "Option for selection Windows 7 - 32 Bit Operating System.") 

;GUICtrlSetTip($PIPE, "Option for selection Windows PIPE Platform.") 
GUICtrlSetTip($submit, "Button to start tbe test process.") 
GUICtrlSetTip($clear, "Button to clear all the selected options.") 
GUICtrlSetTip($exit, "Exit the Core Application Checker Tool.") 
GUISetState() 
TrayTip($Title, "Select the option and click on check to start the test process", 30, 1) 
While 1 
$msg = GUIGetMsg() 
If $msg = $GUI_EVENT_CLOSE Then Exit 
If $msg = $fileitem1 Then Call("about") 
If $msg = $fileitem Then ShellExecute("c:\temp\coreapps.chm", @SW_MAXIMIZE) 
If $msg = $exit Then Exit 
WEnd 
EndFunc ;==>form1 

Func about() 
WinSetState($GUIGD, "", @SW_DISABLE) 
Global $font = "Times New Roman" 
$Form2 = GUICreate("About - Core Apps", 518, 242, 503, 319, BitOR($WS_MINIMIZEBOX, $WS_GROUP, $WS_CLIPSIBLINGS)) 
GUISetIcon("C:\temp\Files\sitemap.ico") 
$GroupBox1 = GUICtrlCreateGroup("", 8, 8, 495, 185) 
$Image1 = GUICtrlCreatePic("C:\temp\Autoit.jpg", 16, 24, 105, 97) 
GUISetFont(11, 400, $font) 
$Label1 = GUICtrlCreateLabel("Product Name: GDCore Application Checker", 172, 64, 318, 27) 
GUISetFont(11, 400, $font) 
$Label2 = GUICtrlCreateLabel("Version: 2 + ", 172, 98, 69, 17, $WS_GROUP) 
GUISetFont(11, 400, $font) 
$Label4 = GUICtrlCreateLabel("Creator: QA Team", 16, 160, 153, 17, $WS_GROUP) 
GUISetFont(11, 400, $font) 

$Button1 = GUICtrlCreateButton("&OK", 202, 148, 75, 25) 
GUISetFont(11, 400, $font) 
GUICtrlCreateGroup("", -99, -99, 1, 1) 

GUISetState(@SW_SHOW) 
While 1 
$nMsg = GUIGetMsg() 
Switch $nMsg 
Case $Button1 
GUIDelete($Form2) 
GUIDelete($GUIGD) 
GUISetState(@SW_ENABLE,$GUIGD) 
Call("form1") 
EndSwitch 
WEnd 
WinActivate("") 
EndFunc ;==>about
Edited by Syed23

Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Share this post


Link to post
Share on other sites
Syed23

Look here

That helped me a lot. Thanks for the immediate response Ahmet!


Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Share this post


Link to post
Share on other sites
guinness

A working Example I posted today >>


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
Syed23

A working Example I posted today >>

This example is more effective and which i was wanted. Thanks guinness ! :)


Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Share this post


Link to post
Share on other sites
guinness

You're Welcome! :)


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.