_WinAPI_SetWindowTitleIcon() v0.96 Build 2012-06-03 Beta

  • _WinAPI_SetWindowTitleIcon() ist eine Funktion, die entweder eine Bild Datei einliest oder ein Memory Bild Handle nimmt, das Bild herunter skaliert und es als Icon im Fenster Titel anzeigt!

    autoit.de/wcf/attachment/14707/


    _WinAPI_SetWindowTitleIcon.au3

    Spoiler anzeigen
    [autoit]


    ;~ #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
    #include-once
    #include <GDIPlus.au3>

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()
    OnAutoItExitRegister("__Exit__")

    [/autoit] [autoit][/autoit] [autoit]

    ;======================================================================================
    ; Function Name: _WinAPI_SetWindowTitleIcon
    ; Description: Loads an image, scales it to desired width or height and creates and icon handle
    ;
    ; Parameters: $sFile: image file to be loaded or bitmap handle
    ; $hWnd: GUI handle where the new icon should be displayed
    ; $iW: new image (icon) width. Default values is 32
    ; $iH: new image (icon) height. Default values is 32
    ;
    ; Requirement(s): GDIPlus.au3, _WinAPI_GetClassLongEx() and _WinAPI_SetClassLongEx()
    ; Return Value(s): Success: HICON handle, Error: 0 (see below)
    ; Error codes: 1: $sFile value is empty
    ; 2: $hWnd is not a windows handle
    ; 3: filename doesn't exist or $sFile is not a valid bitmap handle
    ; 4: unable to create image from file
    ; 5: unable to create thumbnail from image handle
    ; 6: unable to create HICON from bitmap handle
    ; 7: unable to set ClassLongEx from GUI handle
    ;
    ; Limitation: only x86 compatible currently
    ;
    ; Author(s): UEZ, Yashied for _WinAPI_GetClassLongEx() and _WinAPI_SetClassLongEx()
    ; Version: v0.96 Build 2012-06-03 Beta
    ;
    ; Remarks: When finished release icon with _WinAPI_DestroyIcon()
    ;=======================================================================================
    Func _WinAPI_SetWindowTitleIcon($sFile, $hWnd, $iW = 32, $iH = 32)
    If $sFile = "" Then Return SetError(1, 0, 0)
    If Not IsHWnd($hWnd) Then Return SetError(2, 0, 0)
    Local Const $GCL_HICON = -14, $GCL_HICONSM = -34
    Local $hImage
    If Not FileExists($sFile) Then
    If _GDIPlus_ImageGetType($sFile) = -1 Then Return SetError(3, @error, 0)
    $hImage = $sFile ;interpret $sFile as a bitmap handle
    Else
    $hImage = _GDIPlus_ImageLoadFromFile($sFile)
    If @error Then Return SetError(4, @error, 0)
    EndIf
    Local $aRes = DllCall($ghGDIPDll, "uint", "GdipGetImageThumbnail", "handle", $hImage, "uint", $iW, "uint", $iH, "int*", 0, "ptr", 0, "ptr", 0)
    If @error Then Return SetError(5, @error, 0)
    Local $hImageScaled = $aRes[4]
    $aRes = DllCall($ghGDIPDll, "uint", "GdipCreateHICONFromBitmap", "handle", $hImageScaled, "int*", 0)
    If @error Then
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_ImageDispose($hImageScaled)
    Return SetError(6, @error, 0)
    EndIf
    Local $hIconNew = $aRes[2]
    _WinAPI_SetClassLongEx($hWnd, $GCL_HICONSM, $hIconNew)
    If @error Then
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_ImageDispose($hImageScaled)
    Return SetError(7, @error, 0)
    EndIf
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_ImageDispose($hImageScaled)
    Return $hIconNew
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func __Exit__()
    _GDIPlus_Shutdown()
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _WinAPI_SetClassLongEx
    ; Description....: Replaces the specified value into the specified window belongs.
    ; Syntax.........: _WinAPI_SetClassLongEx ( $hWnd, $iIndex, $iNewLong )
    ; Parameters.....: $hWnd - Handle to the window.
    ; $iIndex - The value to be replaced. This parameter can be one of the following values.
    ;
    ; $GCL_CBCLSEXTRA
    ; $GCL_CBWNDEXTRA
    ; $GCL_HBRBACKGROUND
    ; $GCL_HCURSOR
    ; $GCL_HICON
    ; $GCL_HICONSM
    ; $GCL_HMODULE
    ; $GCL_MENUNAME
    ; $GCL_STYLE
    ; $GCL_WNDPROC
    ;
    ; $iNewLong - The replacement value.
    ; Return values..: Success - The previous value.
    ; Failure - 0 and sets the @error flag to non-zero.
    ; Author.........: Yashied
    ; Modified.......:
    ; Remarks........: None
    ; Related........:
    ; Link...........: @@MsdnLink@@ SetClassLong
    ; Example........: Yes
    ; ===============================================================================================================================
    Func _WinAPI_SetClassLongEx($hWnd, $iIndex, $iNewLong)
    Local $Ret
    If @AutoItX64 Then
    $Ret = DllCall('user32.dll', 'ulong_ptr', 'SetClassLongPtrW', 'hwnd', $hWnd, 'int', $iIndex, 'long_ptr', $iNewLong)
    Else
    $Ret = DllCall('user32.dll', 'ulong', 'SetClassLongW', 'hwnd', $hWnd, 'int', $iIndex, 'long', $iNewLong)
    EndIf
    If (@error) Or (Not $Ret[0]) Then Return SetError(1, 0, 0)
    Return $Ret[0]
    EndFunc ;==>_WinAPI_SetClassLongEx
    #endregion

    [/autoit]

    Beispiel1 (lädt ein Bild):

    Spoiler anzeigen
    [autoit]


    #include <GDIPlus.au3>
    #include <WindowsConstants.au3>
    #include "_WinAPI_SetWindowTitleIcon.au3"

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()
    Global Const $sFile = StringReplace(@AutoItExe, "autoit3.exe", "Examples\GUI\Torus.png")

    [/autoit] [autoit][/autoit] [autoit]

    Global $hWnd = GUICreate("Display Windows Title Icon from file by UEZ 2011", -1, -1, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU), $WS_EX_DLGMODALFRAME)
    Global $hIcon_New = _WinAPI_SetWindowTitleIcon($sFile, $hWnd)
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    If GUIGetMsg("") = -3 Then
    _WinAPI_DestroyIcon($hIcon_New)
    _GDIPlus_Shutdown()
    GUIDelete($hWnd)
    ExitLoop
    EndIf
    WEnd

    [/autoit]

    Beispiel 2 (lädt ein Bild vom Speicher):

    Spoiler anzeigen
    [autoit]


    #include <GDIPlus.au3>
    #include <Memory.au3>
    #include <WindowsConstants.au3>
    #include "_WinAPI_SetWindowTitleIcon.au3"

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()
    Global $hWnd = GUICreate("Display Windows Title Icon from file by UEZ 2011", -1, -1, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU), $WS_EX_DLGMODALFRAME)
    Global $hMemImage = Load_BMP_From_Mem(_GIF())
    Global $hIcon_New = _WinAPI_SetWindowTitleIcon($hMemImage, $hWnd)
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    If GUIGetMsg("") = -3 Then
    _WinAPI_DestroyIcon($hIcon_New)
    _GDIPlus_Shutdown()
    GUIDelete($hWnd)
    Exit
    EndIf
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    ;======================================================================================
    ; Function Name: Load_BMP_From_Mem
    ; Description: Loads an image which is saved as a binary string and converts it to a bitmap or hbitmap
    ;
    ; Parameters: $bImage: the binary string which contains any valid image which is supported by GDI+
    ; Optional: $hHBITMAP: if false a bitmap will be created, if true a hbitmap will be created
    ;
    ; Remark: hbitmap format is used generally for GUI internal images, $bitmap is more a GDI+ image format
    ;
    ; Requirement(s): GDIPlus.au3, Memory.au3
    ; Return Value(s): Success: handle to bitmap or hbitmap, Error: 0
    ; Error codes: 1: $bImage is not a binary string
    ; 2: unable to create stream on HGlobal
    ; 3: unable to create bitmap from stream
    ;
    ; Author(s): UEZ
    ; Additional Code: thanks to progandy for the MemGlobalAlloc and tVARIANT lines
    ; Version: v0.96 Build 2011-08-14 Beta
    ;=======================================================================================
    Func Load_BMP_From_Mem($bImage, $hHBITMAP = False)
    If Not IsBinary($bImage) Then Return SetError(1, 0, 0)
    Local $declared = True
    If Not $ghGDIPDll Then
    _GDIPlus_Startup()
    $declared = False
    EndIf
    Local $aResult
    Local Const $memBitmap = Binary($bImage) ;load image saved in variable (memory) and convert it to binary
    Local Const $len = BinaryLen($memBitmap) ;get length of image
    Local Const $hData = _MemGlobalAlloc($len, $GMEM_MOVEABLE) ;allocates movable memory ($GMEM_MOVEABLE = 0x0002)
    Local Const $pData = _MemGlobalLock($hData) ;translate the handle into a pointer
    Local $tMem = DllStructCreate("byte[" & $len & "]", $pData) ;create struct
    DllStructSetData($tMem, 1, $memBitmap) ;fill struct with image data
    _MemGlobalUnlock($hData) ;decrements the lock count associated with a memory object that was allocated with GMEM_MOVEABLE
    $aResult = DllCall("ole32.dll", "int", "CreateStreamOnHGlobal", "handle", $pData, "int", True, "ptr*", 0) ;Creates a stream object that uses an HGLOBAL memory handle to store the stream contents
    If @error Then SetError(2, 0, 0)
    Local Const $hStream = $aResult[3]
    $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromStream", "ptr", $hStream, "int*", 0) ;Creates a Bitmap object based on an IStream COM interface
    If @error Then SetError(3, 0, 0)
    Local Const $hBitmap = $aResult[2]
    Local $tVARIANT = DllStructCreate("word vt;word r1;word r2;word r3;ptr data; ptr")
    DllCall("oleaut32.dll", "long", "DispCallFunc", "ptr", $hStream, "dword", 8 + 8 * @AutoItX64, _
    "dword", 4, "dword", 23, "dword", 0, "ptr", 0, "ptr", 0, "ptr", DllStructGetPtr($tVARIANT)) ;release memory from $hStream to avoid memory leak
    $tMem = 0
    $tVARIANT = 0
    If $hHBITMAP Then
    Local Const $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    _GDIPlus_BitmapDispose($hBitmap)
    If Not $declared Then _GDIPlus_Shutdown()
    Return $hHBmp
    EndIf
    If Not $declared Then _GDIPlus_Shutdown()
    Return $hBitmap
    EndFunc ;==>Load_BMP_From_Mem

    [/autoit] [autoit][/autoit] [autoit]

    Func _GIF()
    Local $GIF
    $GIF &= 'R0lGODlhRABHAPcAAP///xgxcRw1fRgtbRw5ghgtaRw1eRw5hsrKyhgxdRw9lhQkYRgxbRQoaRQ1fRg1eRw5ihg1dSBBkhQtZcLCwr6SlhQkWSA9kq6qrsaamrKytrq2tsrKzr6qQRQtdSA5ijldlhg1hhQx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DlGfghyAyoxB7McGQagKMS+mBAmJkM1HQYQQsI3usMZqCFKyNyacCyWAQbznEEM7hAyWSeQJuvoALNwAIKUNBCC6b85hvAgQ2J2MEO5LFkG0/AAipILXNOAQYLxBaRN1hEOxqgygWseQYNaEBQfZCCFHxIBW8otTwYPYAUGGITIIi1rGP9BplB6da4TkhAAAA7'
    Return Binary(_Base64Decode($GIF))
    EndFunc ;==>_GIF

    [/autoit] [autoit][/autoit] [autoit]

    Func _Base64Decode($input_string)
    Local $struct = DllStructCreate("int")
    Local $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "int", 0, "int", 1, "ptr", 0, "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0)
    If @error Or Not $a_Call[0] Then Return SetError(1, 0, "")
    Local $a = DllStructCreate("byte[" & DllStructGetData($struct, 1) & "]")
    $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "int", 0, "int", 1, "ptr", DllStructGetPtr($a), "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0)
    If @error Or Not $a_Call[0] Then Return SetError(2, 0, "")
    Return DllStructGetData($a, 1)
    EndFunc ;==>_Base64Decode

    [/autoit]

    To do:
    Wenn man eine GUI erstellt, sie mit einem neue Icon versieht, die GUI löscht und eine neue GUI erstellt und sie wiederum mit einem Icon versehen will, funzt das Ganze nicht mehr! ?(
    Sollte jetzt funzen.

    Läuft nur unter x86 Mode!

    Gruß,
    UEZ

  • Also Beispiel 2 geht bei mir. Beispiel eins bringt zwar keine Fehler aber er zeigt auch kein Icon an, auch nicht bei direkter Pfad Angabe zu einem Bild.

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.

  • Hat jemand noch das gleiche Problem?

    Ich habe es unter Win7 x64 (Aero an) und WinXP x86 (Luna an) getestet und beide Beispiele funzen!

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

  • Genau die selbe Idee kam mir auch vor 2 Stunden.

    Jetzt wo ich gerade zum suchen anfange finde ich gleich deins. :D

    Finde ich eine sehr gute Idee, werde es mal testen.

    MfG,
    Nestos.

    Edit:
    1. Beispiel: Funktioniert nachdem ich den direkten Pfad angegeben habe.
    2. Beispiel: Funktioniert sofort

    OS Win7 64Bit Professional SP1

    Zitat

    [Heute, 11:39] Raupi: Soll ich es dir machen?
    [Heute, 11:47] BugFix: "Soll ich es dir machen? " - also Raupi !! bitte nicht so öffentlich :rofl:

    Zitat

    [Heute, 11:51] BugFix: und ich werde es mir jetzt machen - das Mittagessen :P

    AMsg UDF v1.00.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%
    OwnStyle UDF Version 1.10.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%

    Einmal editiert, zuletzt von H2112 (6. Dezember 2011 um 11:17)

  • Klappt es direkt, wenn du diese Zeilen in Beispiel 1 benutzt?

    [autoit]


    Global $hklm = "HKLM"
    If @AutoItX64 Then $hklm = "HKLM64"
    Global Const $sFile = RegRead($hklm & "\SOFTWARE\AutoIt v3\AutoIt", "InstallDir") & "\Examples\GUI\Torus.png"

    [/autoit]

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

    Einmal editiert, zuletzt von UEZ (6. Dezember 2011 um 14:23)

  • Also unter XP funktioniert es tadellos.
    Hab als Pfad das genommen, weil ich AutoIt nicht direkt installiert habe:

    [autoit]

    Global Const $sFile = StringReplace(@AutoItExe, "autoit3.exe", "Examples\GUI\Torus.png")

    [/autoit]

    Edit: Das läuft bei x86 und x64:

    [autoit]

    Global Const $sFile = StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", 0, -1)) & "\Examples\GUI\Torus.png"

    [/autoit]