Jump to content
Sign in to follow this  

About Box issue

Recommended Posts

Hi everyone, 

Hope you're doing great today.

I've made a script that include 5 GUIS all containing a little menu bar.

    ;GUI Menus
Func Menus()    
    Global $MenuItem1 = GUICtrlCreateMenu("?")
    Global $MenuItem2 = GUICtrlCreateMenuItem ("Help", $Menuitem1)
    Global $MenuItem3 = GUICtrlCreateMenu("Exits")
    Global $MenuItem4 = GUICtrlCreateMenuItem("Exit Software", $MenuItem3)
    Global $MenuItem5 = GUICtrlCreateMenuItem("Exit And Delete Resources", $MenuItem3)
    Global $MenuItem6 = GUICtrlCreateMenu("About")
    Global $MenuItem7 = GUICtrlCreateMenuItem("About", $MenuItem6)

And here's one of my GUI's:

    ; Creating Tech GID GUI
Func TechGui ()
    Global $TechGui = GUICreate ("Automated Task List Suite", 270, 180, -1, -1)
    GUISetIcon ($Images & "\TechGUI.ico")
    GUISetBkColor ($Color_White)
    GUICtrlCreatePic ($Images & "\SAClogo.jpg", 14, 10, 240, 80)
    GUICtrlCreateLabel ("Please Enter Your Global ID:", -1, 100, 150, 20)
    GUICtrlSetFont (-1, 8.5, 700, 0)
    Local $TechGiDInput = GUICtrlCreateInput ("", -1, 130, 100, 20)
    Local $TechBtn = GUICtrlCreateButton ("OK", 120, 127, 30, 25, 0x0001)
    While 1
        GUISetState ()
        Local $TechMsg = GUIGetMsg ()
        Switch $TechMsg
            Case $GUI_EVENT_CLOSE
            Case $TechBtn
                Global $TechGiD = GUICtrlRead ($TechGiDInput)
                 FileOpen ($Resources & "\TechGID.txt", $FO_OVERWRITE)
                    FileWrite ($Resources & "\TechGID.txt", $techGID)
                    FileClose ($Resources & "\TechGID.txt")
                If  ($TechGiD == "") Then
                    Msgbox (16, "ERROR", "You can't be a ghost, try again")
                    GUIDelete ($TechGui)
                    CmpModelGui ()
                        Case $TechMsg = $MenuItem7

The problem is that when I call the about box and when I close it, all buttons from the calling GUI are disabled... Also, is it possible to create a general about box without having to associate it to the GUI calling it?

In fact, I'd love to have this kind of AboutBox: 

#Include <GUIConstantsEx.au3>

$hForm = GUICreate('MyGUI', 400, 400)
$Button = GUICtrlCreateButton('About', 165, 366, 70, 23)

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
        Case $Button
            _WinAPI_ShellAbout('About', 'About Dialog Box Test', 'Simple Text', _WinAPI_SHExtractIcons('shell32.dll', 130, 33, 33), $hForm)

Func _WinAPI_ShellAbout($sTitle, $sName, $sText, $hIcon = 0, $hParent = 0)

    Local $Ret = DllCall('shell32.dll', 'int', 'ShellAbout', 'hwnd', $hParent, 'str', $sTitle & '#' & $sName, 'str', $sText, 'ptr', $hIcon)

    If (@error) Or ($Ret[0] = 0) Then
        Return SetError(1, 0, 0)
    Return 1
EndFunc   ;==>_WinAPI_ShellAbout

Func _WinAPI_SHExtractIcons($sIcon, $iIndex, $iWidth, $iHeight)

    Local $Ret = DllCall('shell32.dll', 'int', 'SHExtractIconsW', 'wstr', $sIcon, 'int', $iIndex, 'int', $iWidth, 'int', $iHeight, 'ptr*', 0, 'ptr*', 0, 'int', 1, 'int', 0)

    If (@error) Or ($Ret[0] = 0) Or ($Ret[5] = Ptr(0)) Then
        Return SetError(1, 0, 0)
    Return $Ret[5]
EndFunc   ;==>_WinAPI_SHExtractIcons

But I don't know how can I personalize it and integrate it in my script.
Many thanks in advance for you generous help :D


Edited by 31290

~~~ Doom Shall Never Die, Only The Players ~~~

Share this post

Link to post
Share on other sites


You really do NOT want to run this in your message loop


For further help please post a runnable reproducer using code tags.


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...