Jump to content



Photo

Click button under the child GUI (possible?)


  • Please log in to reply
3 replies to this topic

#1 playlet

playlet

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 459 posts

Posted 14 April 2012 - 08:59 AM

Hi!

Is it possible to click a button on parent GUI if there is a non-transparent child GUI on top of it?

Thanks!

#include <WindowsConstants.au3> $MainW = GUICreate("Main", 300, 200, -1, -1) $Btn = GUICtrlCreateButton("Button", 10, 10, 200, 50) GUISetState() $ChildW = GUICreate("Child", 300, 200, -1, -1, $WS_POPUP, -1, $MainW) WinSetTrans($ChildW, "", 230) GUISetState() While 1     Switch GUIGetMsg()         Case -3             Exit         Case $Btn             MsgBox(262144, "", "Button clicked")     EndSwitch WEnd






#2 guinness

guinness

    guinness

  • MVPs
  • 10,234 posts

Posted 14 April 2012 - 09:18 AM

I believe this is the only approach >>

AutoIt         
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Example() Func Example()     Local $hGUI = GUICreate("Main", 300, 200, -1, -1)     Local $iButton_1 = GUICtrlCreateButton("Button", 10, 10, 200, 50)     GUISetState(@SW_SHOW, $hGUI)     Local $hChild = GUICreate("Child", 300, 200, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hGUI)     Local $iButton_2 = GUICtrlCreateButton("Button", 10, 10, 200, 50)     WinSetTrans($hChild, "", 230)     GUISetState(@SW_SHOW, $hChild)     While 1         Switch GUIGetMsg()             Case $GUI_EVENT_CLOSE                 ExitLoop             Case $iButton_1, $iButton_2                 MsgBox(4096, "", "Button Clicked")         EndSwitch     WEnd     GUIDelete($hGUI)     GUIDelete($hChild) EndFunc   ;==>Example

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_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()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_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()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#3 playlet

playlet

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 459 posts

Posted 14 April 2012 - 09:25 AM

Yeah, I thought there was a better way to do it but it looks like this is the only way to do it...
Thanks, guinness! ;)

#4 guinness

guinness

    guinness

  • MVPs
  • 10,234 posts

Posted 14 April 2012 - 10:08 AM

Who knows? Maybe there is a better solution?

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_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()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_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()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users