Jump to content

About Dialog Box


Yashied
 Share

Recommended Posts

This is a Windows default About Dialog Box.

#Include <GUIConstantsEx.au3>

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

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

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)
    EndIf
    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)
    EndIf
    Return $Ret[5]
EndFunc   ;==>_WinAPI_SHExtractIcons
Link to comment
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
 Share

  • Recently Browsing   0 members

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