Jump to content

Recommended Posts

Posted

Nice. Those functions can found in GUIMenu.au3 by the way.

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

  • 5 months later...
Posted (edited)

Hi guinness,

your function have problem on autoit 3.3.10.2 .

When i disable a gui and i click on the disabled gui then there is no ring sound...

can you fix it and tell me what area in the code you fixed?

thanks

Edited by Guest
Posted

Erm...ring sound? Probably the worst bug report I have encountered. The code works for, so it's something your end. Good lucking fixing it!

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

Posted (edited)

Erm...ring sound? Probably the worst bug report I have encountered. The code works for, so it's something your end. Good lucking fixing it!

Ok .. I know it's a funny bug ..

But i want everything works perfectly

I'll try to fix it and if I do not succeed then I ask you to fix it.

If I can fix it, I'll send the patch code here.

Edited by Guest
Posted

I don't know what you problem is.

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

Posted

I don't know what you problem is.

What do you mean?

You do not understand the bug, or something else?

Posted

Maybe I am dumb, but what does ring sound mean? As I said there is no bug at my end, so I am not going to go hunting for something that doesn't exist.

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

Posted

I think he's referring to the sound Windows makes when you click on a disabled GUI.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

Do people still use Windows sounds? Well set the GUI to @SW_DISABLE with GUISetState().

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

Posted (edited)

I think he's referring to the sound Windows makes when you click on a disabled GUI.

Yes, exactly.

This is exactly what I mean.

 

When i clicking on the disabled GUI then there is not sound..

Just sometimes hard for me to explain the problem with my English.

 

Do people still use Windows sounds? Well set the GUI to @SW_DISABLE with GUISetState().

when i use GUISetState() with @SW_DISABLE then for some reson the GUI window changing to inactive...

Forget it .. you probably do not understand. In simple words - I have a problem when I use GUISetState to disable a GUI window and this is one of my reasons to use your _GUIDisable().

if i will solve the problem with GUISetState() then i will have again the previous problem.

Edited by Guest
Posted (edited)

#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7

#include <Constants.au3>
#include <_GUIDisable.au3>
#include <Misc.au3>

Example_1()

Func Example_1()
    Local $hGUI = GUICreate('_GUIDisable()', 300, 100, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MINIMIZEBOX))
    Local $iButton_1 = GUICtrlCreateButton('Effect 1', 5, 5, 100, 25)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKSIZE + $GUI_DOCKTOP)

    Local $iButton_2 = GUICtrlCreateButton('Effect 2', 5, 30, 100, 25)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKSIZE + $GUI_DOCKTOP)

    GUISetState(@SW_SHOW, $hGUI)


    Local $hDisableGUI = 0, $hTimer = 0
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop

            Case $iButton_1
                ; Enable the dimmed effect on the current GUI with the animation turned on.
                GuiMenuDisable($hGUI,0)
                _GUIDisable(-1, 1, 25)
                ;MsgBox($MB_SYSTEMMODAL, '_GUIDisable()', 'See how the GUI is now dimmed. Once you select OK, you''ll have 5 seconds to re-size the GUI!' & @CRLF & @CRLF & _
                ;        'If you wish to exit the 5 second timer, then simply select "Close" to exit the loop.')
                $hTimer = TimerInit()
                Do
                    ; Exit the loop if $GUI_EVENT_CLOSE is captured by GUIGetMsg().
                    If GUIGetMsg() = $GUI_EVENT_CLOSE Then
                    ExitLoop
                    Endif

                    ;chord if clicked

                    If _ispressed("01") Then SoundPlay("C:\Windows\Media\chord.wav")



                    Sleep(10)
                Until TimerDiff($hTimer) > 5000

                ; Disable the dimmed effect with the animation turned on and add focus to the current GUI.
                _GUIDisable(-1, 1)
                GuiMenuDisable($hGUI,1)
            Case $iButton_2
                ; Enable the dimmed effect on the current GUI without the animation.
                GuiMenuDisable($hGUI,0)
                $hDisableGUI = _GUIDisable($hGUI, 0, 25, 25)

                $hTimer = TimerInit()
                Do
                    ; Exit the loop if $GUI_EVENT_CLOSE is captured by GUIGetMsg().
                    If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop

                    ;chord if clicked
                    If _ispressed("01") Then SoundPlay("C:\Windows\Media\chord.wav")

                    Sleep(10)
                Until TimerDiff($hTimer) > 5000

                _GUIDisable($hGUI, 0)
                GuiMenuDisable($hGUI,1)

        EndSwitch
    WEnd
    GUIDelete($hGUI)
EndFunc

Func GuiMenuDisable($hWnd,$sate)
    $dSysMenu = DllCall("User32.dll", "hwnd", "GetSystemMenu", "hwnd", $hWnd, "int", $sate)
    DllCall("User32.dll", "int", "RemoveMenu", "hwnd", $dSysMenu[0], "int", 0xF060, "int", $sate)
    DllCall("User32.dll", "int", "DrawMenuBar", "hwnd", $hWnd)
EndFunc

Not the most responsive way to do it, but at least an idea of how to audibly notify during the disabled period

*edit put Gil's naming convention back

Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

  • 3 years later...
Posted (edited)

Does anyone have this UDF in a version that can handle more than a single window?

E.g. Launch Main GUI

-> press button to open 1st Child GUI

-> Main GUI gets dimmed/disabled

-> click a button inside 1st Child GUI, 2nd Child GUI is opened

-> 1st Child GUI is dimmed/disabled.

Edited by mpower
Posted
On 3.5.2017 at 4:33 AM, mpower said:

Does anyone have this UDF in a version that can handle more than a single window?

E.g. Launch Main GUI

-> press button to open 1st Child GUI

-> Main GUI gets dimmed/disabled

-> click a button inside 1st Child GUI, 2nd Child GUI is opened

-> 1st Child GUI is dimmed/disabled.

Yes, I have a modified UDF that doing exactly what you want

Posted

Cool

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

Posted

Try this

 

#include <Array.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>


#cs
    $sate = 1 = enable the GUI
    $sate = 0 = disable the GUI
    $br = brightness level of disabled GUI
    $bColor = color of disabled GUI

#ce

Func GuiDisableEnable($hGUI, $sate, $br = 25, $DisableMenu = 1, $bColor = 0x000000)

    Local Static $avGUI[1] = [0]

    Switch $sate
        Case 0
            If $DisableMenu = 1 Then GuiMenuDisable($hGUI, 0)
            $vGUI = _GUIDisable($hGUI, 0, $br, $bColor)
            GUISetState(@SW_DISABLE, $vGUI)
            _ArrayAdd($avGUI, $vGUI)
            $avGUI[0] += 1

        Case 1
            If $DisableMenu = 1 Then GuiMenuDisable($hGUI, 1)
            $MaxVGui = UBound($avGUI) - 1
            If $MaxVGui = 0 Then Return
            _GUIDisable($avGUI[$MaxVGui], 1)
            _ArrayDelete($avGUI, $MaxVGui)
            ;ConsoleWrite($MaxVGui &" (Line "&@ScriptLineNumber&")"&@CRLF)
            $avGUI[0] -= 1

    EndSwitch


    ;_ArrayDisplay($avGUI)
EndFunc   ;==>GuiDisableEnable


#Region Internal use

    Func GuiMenuDisable($hWnd, $sate)
        Local $dSysMenu = DllCall("User32.dll", "hwnd", "GetSystemMenu", "hwnd", $hWnd, "int", $sate)
        DllCall("User32.dll", "int", "RemoveMenu", "hwnd", $dSysMenu[0], "int", 0xF060, "int", $sate)
        DllCall("User32.dll", "int", "DrawMenuBar", "hwnd", $hWnd)
    EndFunc   ;==>GuiMenuDisable

    Func _GUIDisable($hWnd = -1, $iDelete = 0, $iBrightness = Default, $bColor = 0x000000)
        Local $vGUI = 0

        If $iBrightness = Default Then
            $iBrightness = 5
        EndIf

        If $hWnd = -1 Then
            Local $iLabel = GUICtrlCreateLabel('', -99, -99, 1, 1)
            $hWnd = _WinAPI_GetParent(GUICtrlGetHandle($iLabel))
            If @error Then
                Return SetError(1, 0 * GUICtrlDelete($iLabel), 0)
            EndIf
            GUICtrlDelete($iLabel)
        EndIf

        If $iDelete Then
            $vGUI = GUIDelete($hWnd)
        Else
            Local $aWinGetPos = WinGetClientSize($hWnd)
            $vGUI = GUICreate('', $aWinGetPos[0], $aWinGetPos[1], 0, 0, $WS_POPUP, $WS_EX_MDICHILD, $hWnd)
            GUISetBkColor($bColor, $vGUI)
            WinSetTrans($vGUI, '', Round($iBrightness * (255 / 100)))
            GUISetState(@SW_SHOW, $vGUI)

        EndIf
        Return $vGUI
    EndFunc   ;==>_GUIDisable
#EndRegion

I took it out of from some big dead project I have.

I don't have time to re test it.. 
I made a small edit to the code but I think it should work. try this and tell me if it works

  • 7 years later...
Posted

14 year later, No One mention about tab, when disable gui, still enable buttons and other GUICtrl are chose with tab. I try GUICtrlSetStyle($button1, 0) to prevent tab disable but Image from button are not working. So I Make like GUICtrlSetState($disabledbutton, $GUI_FOCUS) trick. I added  GUICtrlSetState($iLabel, $GUI_FOCUS) to the _GUIDisable main udf. Is there any other way to prevent to TAB.

#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <WindowsConstants.au3>
#include "_GUIDisable.au3"
_Main()


Func _Main()
Local $hGUI, $iButton_1,$iButton_2, $iLabel, $iTimer

$hGUI = GUICreate("_GUIDisable_but_Tab_Enable", 300, 100, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MINIMIZEBOX))
$iButton_1 = GUICtrlCreateButton("Effect 1", 190, 70, 100, 25)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKSIZE + $GUI_DOCKTOP)
$iButton_2 = GUICtrlCreateButton("TAB Enabled :(", 10, 70, 100, 25)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKSIZE + $GUI_DOCKTOP)
GUISetState(@SW_SHOW, $hGUI)

While 1
  Switch GUIGetMsg()
   Case $GUI_EVENT_CLOSE, $iButton_2
    Exit
   Case $iButton_1
    _GUIDisable(-1, 1, 25) ; Enable the dimmed effect on the current GUI with the animation turned on.
    $iLabel = GUICtrlCreateLabel("SimpleText", 5, 5) ; Create a label with some text after calling _GUIDisable().
    MsgBox(0, "Hello", "Press TAB Key to focus the buttons", 0, $hGUI)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    $iTimer = TimerInit()
    Do
     If GUIGetMsg() = $GUI_EVENT_CLOSE Then ; Exit the loop if $GUI_EVENT_CLOSE is captured by GUIGetMsg().
      ExitLoop
     EndIf
     Sleep(10)
    Until TimerDiff($iTimer) > 3000
    GUICtrlDelete($iLabel) ; Delete the control  before closing _GUIDisable()
    _GUIDisable(-1, 1) ; Disable the dimmed effect with the animation turned on and add focus to the current GUI.
  EndSwitch
WEnd
EndFunc   ;==>_Main

 

Added_GUIFocus_To_UDF.png

Posted (edited)
5 hours ago, PoneToungthar said:

Is there any other way to prevent to TAB.

Yes there is numerous ways to achieve that, I am just trying to figure out what exactly you are asking.

5 hours ago, PoneToungthar said:

I try GUICtrlSetStyle($button1, 0) to prevent tab disable but Image from button are not working

From my understanding you want to prevent tab to buttons but want to keep the image ($BS_BITMAP) style.  So just set the styles you want like this :

#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <Constants.au3>
#include <GUIConstants.au3>
#include "_GUIDisable.au3"

_Main()

Func _Main()
  Local $hGUI, $iButton_1, $iButton_2, $iTimer

  $hGUI = GUICreate("_GUIDisable_but_Tab_Enable", 300, 200, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MINIMIZEBOX))
  $iButton_1 = GUICtrlCreateButton("Effect 1", 190, 70, 100, 50, $BS_BITMAP)
  GUICtrlSetImage(-1, "Ok.bmp")
  GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKSIZE + $GUI_DOCKTOP)
  $iButton_2 = GUICtrlCreateButton("TAB Enabled :(", 10, 70, 100, 50, $BS_BITMAP)
  GUICtrlSetImage(-1, "Cancel.bmp")

  GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKSIZE + $GUI_DOCKTOP)
  GUISetState(@SW_SHOW, $hGUI)

  While 1
    Switch GUIGetMsg()
      Case $GUI_EVENT_CLOSE, $iButton_2
        Exit
      Case $iButton_1
        _GUIDisable(-1, 1, 25) ; Enable the dimmed effect on the current GUI with the animation turned on.
        GUICtrlSetStyle($iButton_1, $BS_BITMAP)
        GUICtrlSetStyle($iButton_2, $BS_BITMAP)

        $iTimer = TimerInit()
        Do
          If GUIGetMsg() = $GUI_EVENT_CLOSE Then ; Exit the loop if $GUI_EVENT_CLOSE is captured by GUIGetMsg().
            ExitLoop
          EndIf
          Sleep(10)
        Until TimerDiff($iTimer) > 3000
        _GUIDisable(-1, 1) ; Disable the dimmed effect with the animation turned on and add focus to the current GUI.
        GUICtrlSetStyle($iButton_1, $WS_TABSTOP + $BS_BITMAP)
        GUICtrlSetStyle($iButton_2, $WS_TABSTOP + $BS_BITMAP)
    EndSwitch
  WEnd
EndFunc   ;==>_Main

With this code, you are not able to TAB out from the buttons but image is correctly displayed.  Is this what you want ?

Edited by Nine
Posted

I think there is only one way to prevent Tab and Arrow, disable GUICtrlSetState($iButton_1, $GUI_DISABLE) and re-enable every time we use _GUIDisable function.

#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <WindowsConstants.au3>
#include "_GUIDisable.au3"
_Main()


Func _Main()
    Local $hGUI, $iButton_1, $iButton_2, $iLabel, $iTimer

    $hGUI = GUICreate("_GUIDisable_but_Tab_Enable", 300, 100, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MINIMIZEBOX))
    $iButton_1 = GUICtrlCreateButton("Effect 1", 190, 70, 100, 25)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKSIZE + $GUI_DOCKTOP)
    $iButton_2 = GUICtrlCreateButton("TAB Enabled :(", 10, 70, 100, 25)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKSIZE + $GUI_DOCKTOP)
    GUISetState(@SW_SHOW, $hGUI)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE, $iButton_2
                Exit
            Case $iButton_1
                _GUIDisable(-1, 1, 25) ; Enable the dimmed effect on the current GUI with the animation turned on.
                GUICtrlSetState($iButton_1, $GUI_DISABLE)
                GUICtrlSetState($iButton_2, $GUI_DISABLE)
                $iLabel = GUICtrlCreateLabel("SimpleText", 5, 5) ; Create a label with some text after calling _GUIDisable().
                MsgBox(0, "Hello", "Now we can't use TAB and Arrow key to select controls.", 0, $hGUI)
                GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
                $iTimer = TimerInit()
                Do
                    If GUIGetMsg() = $GUI_EVENT_CLOSE Then ; Exit the loop if $GUI_EVENT_CLOSE is captured by GUIGetMsg().
                        ExitLoop
                    EndIf
                    Sleep(10)
                Until TimerDiff($iTimer) > 3000
                GUICtrlDelete($iLabel) ; Delete the control  before closing _GUIDisable()
                _GUIDisable(-1, 1) ; Disable the dimmed effect with the animation turned on and add focus to the current GUI.
                GUICtrlSetState($iButton_1, $GUI_ENABLE)
                GUICtrlSetState($iButton_2, $GUI_ENABLE)
        EndSwitch
    WEnd
EndFunc   ;==>_Main

 

Posted (edited)

Right, then another solution would be to disable keyboard during the time the GUI is disabled...

#include <Constants.au3>
#include <GUIConstants.au3>
#include "_GUIDisable.au3"

Opt("MustDeclareVars", True)

Global $hHook, $bDisable

_Main()

Func _Main()
  GUICreate("_GUIDisable_but_Tab_Enable", 300, 200, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MINIMIZEBOX))
  Local $iButton_1 = GUICtrlCreateButton("Effect 1", 190, 70, 100, 50, $BS_BITMAP)
  GUICtrlSetImage(-1, "Ok.bmp")
  GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKSIZE + $GUI_DOCKTOP)
  Local $iButton_2 = GUICtrlCreateButton("TAB Enabled :(", 10, 70, 100, 50, $BS_BITMAP)
  GUICtrlSetImage(-1, "Cancel.bmp")
  GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKSIZE + $GUI_DOCKTOP)

  Local $hProc = DllCallbackRegister(WH_KEYBOARD, "long", "int;wparam;lparam")
  $hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD, DllCallbackGetPtr($hProc), 0, _WinAPI_GetCurrentThreadId())
  GUISetState()
  Local $iTimer

  While 1
    Switch GUIGetMsg()
      Case $GUI_EVENT_CLOSE, $iButton_2
        ExitLoop
      Case $iButton_1
        _GUIDisable(-1, 1, 25) ; Enable the dimmed effect on the current GUI with the animation turned on.
        $bDisable = True
        $iTimer = TimerInit()
        Do
          If GUIGetMsg() = $GUI_EVENT_CLOSE Then ; Exit the loop if $GUI_EVENT_CLOSE is captured by GUIGetMsg().
            ExitLoop
          EndIf
          Sleep(10)
        Until TimerDiff($iTimer) > 3000
        _GUIDisable(-1, 1) ; Disable the dimmed effect with the animation turned on and add focus to the current GUI.
        $bDisable = False
    EndSwitch
  WEnd
  _WinAPI_UnhookWindowsHookEx($hHook)
  DllCallbackFree($hProc)
EndFunc   ;==>_Main

Func WH_KEYBOARD($nCode, $wParam, $lParam)
  If $nCode >= 0 And $bDisable Then Return 1
  Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
EndFunc   ;==>WH_KEYBOARD

ps. that way you don't get an annoying sound when you press a key while GUI is disabled

Edited by Nine

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...