UDF > WinAPIEx > GDI > BitMaps >


_WinAPI_AddIconOverlay

Cr�e une ic�ne en fusionnant une ic�ne source avec un masque de superposition

#include <WinAPIGdi.au3>
_WinAPI_AddIconOverlay ( $hIcon, $hOverlay )

Param�tres

$hIcon Handle de l'ic�ne source.
$hOverlay Handle de l'ic�ne � utiliser comme masque de superposition.

Valeur de retour

Succ�s: Retourne le handle de l'ic�ne nouvellement cr��e.
�chec: Retourne 0 et d�finit @error <> 0.

Remarques

Les ic�nes source et de superposition doivent �tre de la m�me taille mais peuvent avoir diff�rentes profondeurs de couleur.
Cette fonction convertit en interne les ic�nes sp�cifi�es en ic�ne 32 bits par pixel.

Lorsque vous avez fini d'utiliser l'ic�ne, d�truisez-la en utilisant la fonction _WinAPI_DestroyIcon().

En relation

_WinAPI_DestroyIcon

Exemple

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WinAPIGdi.au3>
#include <WinAPIIcons.au3>
#include <WinAPIShellEx.au3>
#include <WinAPISys.au3>

; Cr�e une ic�ne avec masque de superposition (48x48)
Local $hIcon = _WinAPI_ShellExtractIcon(@SystemDir & '\shell32.dll', 1, 32, 32)
Local $hOverlay
If Number(_WinAPI_GetVersion()) >= 6.0 Then
    $hOverlay = _WinAPI_ShellExtractIcon(@SystemDir & '\imageres.dll', 154, 32, 32)
Else
    $hOverlay = _WinAPI_ShellExtractIcon(@SystemDir & '\shell32.dll', 29, 32, 32)
EndIf
Local $hResult = _WinAPI_AddIconOverlay($hIcon, $hOverlay)
_WinAPI_DestroyIcon($hIcon)
_WinAPI_DestroyIcon($hOverlay)

; Cr�e une GUI
GUICreate('Test ' & StringReplace(@ScriptName, '.au3', '()'), 128, 128)
GUICtrlCreateIcon('', 0, 48, 48, 32, 32)
GUICtrlSendMsg(-1, $STM_SETIMAGE, 1, $hResult)
GUISetState(@SW_SHOW)

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE