Sign in to follow this  
Followers 0
behdadsoft

Disable GUI Father

7 posts in this topic

Hi.

I create a about dialog for my main GUI. now I want when about dialog is running Main GUI Disable and user can't click on buttons.how can do it?

Thanks

Share this post


Link to post
Share on other sites



GUISetState will do it for you:

#include <GUIConstantsEx.au3>

$GUI = GUICreate("test", 200, 100)
$About = GUICtrlCreateButton("About", 50, 10, 100, 25)
GUISetState(@SW_SHOW, $GUI)

Do
    $MSG = GUIGetMsg()
    Switch $MSG
        Case $GUI_EVENT_CLOSE
            Exit
        Case $About
            GUISetState(@SW_HIDE, $GUI)
            MsgBox(0, "Test", "Test")
            GUISetState(@SW_SHOW, $GUI)
    EndSwitch
    Sleep(50)
Until True == False
 

You can use another GUI instead of a message box if you want, that makes no difference.

Ian


My projects:

  • IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged.
  • INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them.
  • PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses.
  • Sync Tool - Folder sync tool with lots of real time information and several checking methods.
  • USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions.
  • Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent.
  • CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction.
  • MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app.
  • 2048 Game - My version of 2048, fun tile game.
  • Juice Lab - Ecigarette liquid making calculator.
  • Data Protector - Secure notes to save sensitive information.
  • VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive.
  • Find in File - Searches files containing a specified phrase.

Share this post


Link to post
Share on other sites

More easy:

#include <GUIConstantsEx.au3>

$GUI = GUICreate("test", 200, 100)
$About = GUICtrlCreateButton("About", 50, 10, 100, 25)
GUISetState(@SW_SHOW, $GUI)

Do
    $MSG = GUIGetMsg()
    Switch $MSG
        Case $GUI_EVENT_CLOSE
            Exit
        Case $About
            MsgBox(0, "Test", "Test", 0, $GUI)
    EndSwitch
    Sleep(50)
Until True == False

Same when creating child GUIs. Just point to parent to disable parent when child is active.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

 

More easy:

#include <GUIConstantsEx.au3>

$GUI = GUICreate("test", 200, 100)

$About = GUICtrlCreateButton("About", 50, 10, 100, 25)

GUISetState(@SW_SHOW, $GUI)

Do

    $MSG = GUIGetMsg()

    Switch $MSG

        Case $GUI_EVENT_CLOSE

            Exit

        Case $About

            MsgBox(0, "Test", "Test", 0, $GUI)

    EndSwitch

    Sleep(50)

Until True == False

Same when creating child GUIs. Just point to parent to disable parent when child is active.

 

this code is Similar to what I want. I want do it without MSGBox. instead of MSGBBox I want call a Function. how can do it?

Do
    $MSG = GUIGetMsg()
    Switch $MSG
        Case $GUI_EVENT_CLOSE
            Exit
        Case $About
            _AboutDialog ()
    EndSwitch
    Sleep(50)
Until True == False
Edited by behdadsoft

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

@UEZ

:P  5 years after picking up AutoIt there are still so many things that I don't know about!!  Gotta keep reading the help doc!!!   :D

@behdadsoft

GUISetState is still an option if nobody else has a better idea (they may!).  put the HIDE first and SHOW after calling your function.

Ian

 

EDIT:

After re-reading your post, I think I was wrong, I thought you wanted to hide the parent GUI.  If all you want to do is disable it when running your function try this:

#include <GUIConstantsEx.au3>

$GUI = GUICreate("test", 200, 100)
$About = GUICtrlCreateButton("About", 50, 10, 100, 25)
GUISetState(@SW_SHOW, $GUI)

Do
    $MSG = GUIGetMsg()
    Switch $MSG
        Case $GUI_EVENT_CLOSE
            Exit
        Case $About
            GUISetState(@SW_DISABLE, $GUI)
            _About()
            GUISetState(@SW_ENABLE, $GUI)
    EndSwitch
    Sleep(50)
Until True == False


Func _About()
    MsgBox(0, "Test", "Test")
EndFunc   ;==>_About
Edited by llewxam

My projects:

  • IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged.
  • INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them.
  • PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses.
  • Sync Tool - Folder sync tool with lots of real time information and several checking methods.
  • USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions.
  • Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent.
  • CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction.
  • MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app.
  • 2048 Game - My version of 2048, fun tile game.
  • Juice Lab - Ecigarette liquid making calculator.
  • Data Protector - Secure notes to save sensitive information.
  • VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive.
  • Find in File - Searches files containing a specified phrase.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Something like this here?

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$GUI = GUICreate("test", 200, 100)
$About = GUICtrlCreateButton("About", 50, 10, 100, 25)
GUISetState(@SW_SHOW, $GUI)

Do
    $MSG = GUIGetMsg()
    Switch $MSG
        Case $GUI_EVENT_CLOSE
            Exit
        Case $About
            _AboutDialog($GUI)
    EndSwitch
    Sleep(50)
Until True = False

Func _AboutDialog($hParentGUI)
    GUISetState(@SW_DISABLE, $hParentGUI)
    Local $hGUI = GUICreate("", 300, 200, -1, -1, Default, Default, $hParentGUI)
    GUICtrlCreateLabel("Child GUI", 0, 0, 300, 200, BitOR($SS_CENTER, $SS_CENTERIMAGE))
    GUICtrlSetFont(-1, 24)
    GUISetState(@SW_SHOW, $hGUI)
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUISetState(@SW_ENABLE, $hParentGUI)
    GUIDelete($hGUI)
EndFunc

@llewxam:  ;)

 

 

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Thank UEZ :)

Thank llewxam :)

Edited by behdadsoft

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