Jump to content

Search the Community

Showing results for tags 'icon exe shell'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. These functions I created to set the icon of GUICtrlCreateIcon using a filepath's icon. For example if you pass the file location of the script file (@ScriptFullPath), then the icon that will be displayed is the icon that is displayed in Windows Explorer, for me this is Notepad. Please see below for more details. Thanks. Example use of Functions: #include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <WinAPIShellEx.au3> Example() Func Example() Local $hGUI = GUICreate('', 128, 128) Local $iIcon = GUICtrlCreateIcon('', 0, 48, 48, 32, 32) ; Set the icon GUICtrlCreateIcon() using the @AutoItExe icon. _Icon_Set(-1, @AutoItExe) GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Clear the GUICtrlCreateIcon() icon. _Icon_Clear($iIcon) ; Delete the GUI. GUIDelete($hGUI) EndFunc ;==>Example Func _Icon_Clear($iCtrlID) ; Returns True or False Local Const $STM_SETIMAGE = 0x0172 If $iCtrlID = Default Or $iCtrlID <= 0 Or Not IsInt($iCtrlID) Then $iCtrlID = _WinAPI_GetDlgCtrlID(GUICtrlGetHandle($iCtrlID)) EndIf Return _WinAPI_DestroyIcon(GUICtrlSendMsg($iCtrlID, $STM_SETIMAGE, $IMAGE_ICON, 0)) EndFunc ;==>_Icon_Clear Func _Icon_Set($iCtrlID, $sFilePath) ; Returns True or False Local Const $STM_SETIMAGE = 0x0172 If $iCtrlID = Default Or $iCtrlID <= 0 Or Not IsInt($iCtrlID) Then $iCtrlID = _WinAPI_GetDlgCtrlID(GUICtrlGetHandle($iCtrlID)) EndIf Local $fReturn = False If FileExists($sFilePath) Then Local $tFILEINFO = DllStructCreate($tagSHFILEINFO) _WinAPI_ShellGetFileInfo($sFilePath, BitOR($SHGFI_ICON, $SHGFI_LARGEICON), 0, $tFILEINFO) Local $hIcon = DllStructGetData($tFILEINFO, 'hIcon') $fReturn = _WinAPI_DestroyIcon(GUICtrlSendMsg($iCtrlID, $STM_SETIMAGE, $IMAGE_ICON, $hIcon)) EndIf Return $fReturn EndFunc ;==>_Icon_Set
×
×
  • Create New...