Jump to content
Sign in to follow this  
wolf9228

Resource project third version

Recommended Posts

wolf9228

By the project you can access resource of exe applications and resource of Dll applications
You can by the project create a picture window The project supports following image formats

gif / bmp / jpg / emf

The project supports  ICON and CURSOR formats exceptionally different from the rest of the formats

new Thing  in this version of the project is Resource Button Hover

project Files

Resource.zip

 

Untitled.png

 

Untitled1.png

Resource.au3

#include <Constants.au3>
#include <WinAPI.au3>
#include <Memory.au3>

Global Const $RT_ACCELERATOR = 9
Global Const $RT_ANICURSOR = 21
Global Const $RT_ANIICON = 22
Global Const $RT_BITMAP = 2
Global Const $RT_CURSOR = 1
Global Const $RT_DIALOG = 5
Global Const $RT_DLGINCLUDE = 17
Global Const $RT_FONT = 8
Global Const $RT_FONTDIR = 7
Global Const $RT_GROUP_CURSOR = ($RT_CURSOR + 11)
Global Const $RT_ICON = 3
Global Const $RT_GROUP_ICON = ($RT_ICON + 11)
Global Const $RT_HTML = 23
Global Const $RT_MANIFEST = 24
Global Const $RT_MENU = 4
Global Const $RT_MESSAGETABLE = 11
Global Const $RT_PLUGPLAY = 19
Global Const $RT_RCDATA = 10
Global Const $RT_STRING = 6
Global Const $RT_VERSION = 16
Global Const $RT_VXD = 20

Func ResGet($ResType,$ResName,$ResLanguage = -1,$ModuleName = "")

Local $DataType1 = "LONG",$DataType2 = "LONG"
Local $LPVOID,$HRSRC,$ResSize,$HGLOBAL


if IsString($ResName) Then
$ResName = StringUpper($ResName)
$DataType1 = "WSTR"
EndIf
If IsString($ResType) Then
$ResType = StringUpper($ResType)
$DataType2 = "WSTR"
EndIf

if StringLen($ModuleName) Then
$HModule = _WinAPI_LoadLibraryEx($ModuleName,$LOAD_LIBRARY_AS_DATAFILE)
if $HModule = 0 Then Return SetError(1,0,0)
Else
$HModule = 0
EndIf

if ($ResLanguage <> -1) Then
$HRSRC = DllCall("Kernel32.dll","ptr","FindResourceExW","ptr",$HModule, _
$DataType2,$ResType,$DataType1,$ResName,"WORD",$ResLanguage)
if @error Or $HRSRC[0] = 0 Then Return SetError(2,0,0)
Else
$HRSRC = DllCall("Kernel32.dll","ptr","FindResourceW","ptr",$HModule, _
$DataType1,$ResName,$DataType2,$ResType)
if @error Or $HRSRC[0] = 0 Then Return SetError(2,0,0)
EndIf

$HRSRC = $HRSRC[0]
$ResSize = DllCall("Kernel32.dll","DWORD","SizeofResource","ptr",$HModule,"ptr",$HRSRC)
if (@error Or $ResSize[0] = 0) Then Return SetError(3,0,0)
$ResSize = $ResSize[0]

$HGLOBAL = DllCall("Kernel32.dll","ptr","LoadResource","ptr",$HModule,"ptr",$HRSRC)
if @error Or $HGLOBAL[0] = 0 Then Return SetError(4,0,0)
$HGLOBAL = $HGLOBAL[0]

$LPVOID = DllCall("Kernel32.dll","ptr","LockResource","ptr",$HGLOBAL)
if @error Or $LPVOID[0] = 0 Then
$BOOL = DllCall("Kernel32.dll","BOOL","FreeResource","ptr",$HGLOBAL)
Return SetError(5,0,0)
EndIf
$LPVOID = $LPVOID[0]

$ByteStruct = DllStructCreate("BYTE[" & $ResSize & "]")
_MemMoveMemory($LPVOID,DllStructGetPtr($ByteStruct),$ResSize)

$BOOL = DllCall("Kernel32.dll","BOOL","FreeResource","ptr",$HGLOBAL)
if ($HModule) Then _WinAPI_FreeLibrary($HModule)

Return SetError(0,$ResSize,$ByteStruct)

EndFunc

Func ResToFile($FileName,$ResType,$ResName,$ResLanguage = -1,$ModuleName = "",$iCreation = 1)

;-----$iCreation----- Only
;0 - Creates a new file. The function fails if the file exists
;1 - Creates a new file. If a file exists, it is overwritten
;-----$iCreation----- Only

Local $nBytes , $ResSize

$ByteStruct = ResGet($ResType,$ResName,$ResLanguage,$ModuleName)
if @error Then Return SetError(1,0,False)
$ResSize = @extended

if ($iCreation <> 0 And $iCreation <> 1) Then Return SetError(2,0,False)

$hFile = _WinAPI_CreateFile($FileName,$iCreation)
if Not($hFile) Then Return SetError(3,0,False)

$Return = _WinAPI_WriteFile($hFile,DllStructGetPtr($ByteStruct),$ResSize,$nBytes)
if Not($Return) Then
_WinAPI_CloseHandle($hFile)
Return SetError(4,0,False)
EndIf

_WinAPI_CloseHandle($hFile)
Return SetError(0,0,True)

EndFunc

Func ResGetString($ResType,$ResName,$ResLanguage = -1,$Unicode = False,$ModuleName = "")

Local $DtatType = "CHAR"

$ByteStruct = ResGet($ResType,$ResName,$ResLanguage,$ModuleName)
if @error Then Return SetError(1,0,0)
$ResSize = @extended
$LPVOID = DllStructGetPtr($ByteStruct)

if ($Unicode) Then
$DtatType = "WCHAR"
$ResSize = Int($ResSize/2)
EndIf

$StrStruct = DllStructCreate($DtatType & "[" & $ResSize & "]",$LPVOID)
if @error Then Return SetError(2,0,0)

$nString = DllStructGetData($StrStruct,1)
Return SetError(0,StringLen($nString),$nString)

EndFunc


Func ResGetImage($ResType,$ResName,$ResLanguage = -1,$ModuleName = "")

Switch $ResType

Case $RT_BITMAP
$hImage = LoadBitmap($ResName,$ModuleName)
if @error Then Return SetError(1,0,0)
Return SetError(0,1,$hImage)

Case $RT_GROUP_ICON
$hImage = LoadIcon($ResName,$ModuleName)
if @error Then Return SetError(2,0,0)
Return SetError(0,3,$hImage)

Case $RT_GROUP_CURSOR
$hImage = LoadCursor($ResName,$ModuleName)
if @error Then Return SetError(3,0,0)
Return SetError(0,5,$hImage)

Case Else

$ByteStruct = ResGet($ResType,$ResName,$ResLanguage,$ModuleName)
if @error Then Return SetError(4,0,0)
$ResSize = @extended

$hMemory = _MemGlobalAlloc($ResSize,$GHND)
if Not($hMemory) Then Return SetError(5,0,0)

$hLock = _MemGlobalLock($hMemory)
if Not($hLock) Then
_MemGlobalFree($hMemory)
Return SetError(6,0,0)
EndIf

_MemMoveMemory(DllStructGetPtr($ByteStruct),$hLock,$ResSize)

$lpstream = CreateStreamOnHGlobal($hLock,True)
if @error Then
_MemGlobalFree($hMemory)
Return SetError(7,0,0)
EndIf

$riid = _WinAPI_GUIDFromString("{7BF80981-BF32-101A-8BBB-00AA00300CAB}")
if @error Then
_MemGlobalFree($hMemory)
Return SetError(8,0,0)
EndIf


$HRESULT = DllCall("OleAut32.dll","LONG","OleLoadPicture","PTR",$lpstream,"LONG", _
$ResSize,"BOOL",True,"ptr",DllStructGetPtr($riid),"idispatch*",0)
if @error Or $HRESULT[0] <> 0 Then
_MemGlobalFree($hMemory)
Return SetError(9,0,0)
EndIf
$iPicture = $HRESULT[5]

_MemGlobalFree($hMemory)
Return SetError(0,Int($iPicture.Type()),Ptr($iPicture.Handle()))

EndSwitch

;PICTYPE_UNINITIALIZED (-1)
;The picture object is currently uninitialized. This value is only valid as a return value
;from IPicture::get_Type and is not valid with the PICTDESC structure.
;PICTYPE_NONE = 0
;A new picture object is to be created without an initialized state. This
;value is valid only in the PICTDESC structure.
;PICTYPE_BITMAP = 1
;The picture type is a bitmap. When this value occurs in the PICTDESC structure,
;it means that the bmp field of that structure contains the relevant initialization parameters.
;PICTYPE_METAFILE = 2
;The picture type is a metafile. When this value occurs in the PICTDESC structure,
;it means that the wmf field of that structure contains the relevant initialization parameters.
;PICTYPE_ICON = 3
;The picture type is an icon. When this value occurs in the PICTDESC structure,
;it means that the icon field of that structure contains the relevant initialization parameters.
;PICTYPE_ENHMETAFILE = 4
;The picture type is an enhanced metafile. When this value occurs in the PICTDESC structure,
;it means that the emf field of that structure contains the relevant initialization parameters.

EndFunc


Func LoadBitmap($lpBitmapName,$ModuleName = "")

Local $DataType = "LONG" , $TestModule = StringLen($ModuleName) <> 0

if ($TestModule) Then
$HModule = _WinAPI_LoadLibraryEx($ModuleName,$LOAD_LIBRARY_AS_DATAFILE)
if $HModule = 0 Then Return SetError(1,0,0)
Else
$HModule = _WinAPI_GetModuleHandle(0)
EndIf

if IsString($lpBitmapName) Then
$lpBitmapName = StringUpper($lpBitmapName)
$DataType = "WSTR"
EndIf

$HBITMAP = DllCall("User32.dll","PTR","LoadBitmapW","PTR",$HModule,$DataType,$lpBitmapName)
if @error Or $HBITMAP[0] = 0 Then
if ($TestModule) Then _WinAPI_FreeLibrary($HModule)
Return SetError(2,0,0)
EndIf

if ($TestModule) Then _WinAPI_FreeLibrary($HModule)
Return SetError(0,0,$HBITMAP[0])

EndFunc

Func LoadIcon($lpIconName,$ModuleName = "")

Local $DataType = "LONG" , $TestModule = StringLen($ModuleName) <> 0

if ($TestModule) Then
$HModule = _WinAPI_LoadLibraryEx($ModuleName,$LOAD_LIBRARY_AS_DATAFILE)
if $HModule = 0 Then Return SetError(1,0,0)
Else
$HModule = _WinAPI_GetModuleHandle(0)
EndIf

if IsString($lpIconName) Then
$lpIconName = StringUpper($lpIconName)
$DataType = "WSTR"
EndIf

$HICON = DllCall("User32.dll","PTR","LoadIconW","PTR",$HModule,$DataType,$lpIconName)
if @error Or $HICON[0] = 0 Then
if ($TestModule) Then _WinAPI_FreeLibrary($HModule)
Return SetError(2,0,0)
EndIf

if ($TestModule) Then _WinAPI_FreeLibrary($HModule)
Return SetError(0,0,$HICON[0])

EndFunc

Func LoadCursor($lpCursorName,$ModuleName = "")

Local $DataType = "LONG" , $TestModule = StringLen($ModuleName) <> 0

if ($TestModule) Then
$HModule = _WinAPI_LoadLibraryEx($ModuleName,$LOAD_LIBRARY_AS_DATAFILE)
if $HModule = 0 Then Return SetError(1,0,0)
Else
$HModule = _WinAPI_GetModuleHandle(0)
EndIf

if IsString($lpCursorName) Then
$lpCursorName = StringUpper($lpCursorName)
$DataType = "WSTR"
EndIf

$HCURSOR= DllCall("User32.dll","PTR","LoadCursorW","PTR",$HModule,$DataType,$lpCursorName)
if @error Or $HCURSOR[0] = 0 Then
if ($TestModule) Then _WinAPI_FreeLibrary($HModule)
Return SetError(2,0,0)
EndIf

if ($TestModule) Then _WinAPI_FreeLibrary($HModule)
Return SetError(0,0,$HCURSOR[0])

EndFunc

Func CreateStreamOnHGlobal($hGlobal,$fDeleteOnRelease)

$WINOLE = DllCall("Ole32.dll","PTR","CreateStreamOnHGlobal","ptr", _
$hGlobal,"BOOL",$fDeleteOnRelease,"PTR*",0)
if @error Or $WINOLE[0] <> 0 Then Return SetError(1,0,0)
Return SetError(0,0,$WINOLE[3])

EndFunc

 

Res_Ctrl.au3

#include <Constants.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <Memory.au3>
#include "Resource.au3"

Global $Global_BackGroundArray[4][1]


Func ResCtrlCreatePic($L,$T,$W,$H,$ResType,$ResName, _
$ResLanguage = -1,$ModuleName = "",$Style = 0,$ExStyle = 0)

$ImageHandle = ResGetImage($ResType,$ResName,$ResLanguage,$ModuleName)
if @error Then Return SetError(1,0,0)
$ImageType = @extended

$ControlID = CtrlCreatePic($ImageHandle,$ImageType,$L,$T,$W,$H,$Style,$ExStyle)
if @error Then Return SetError(2,0,0)

Return SetError(0,$ImageType,$ControlID)

EndFunc

Func ResCtrlCreatePicEx($L,$T,$W,$H,$Text,$ResType,$ResName,$ResLanguage = -1, _
$ModuleName = "",$Style = 0,$ExStyle = 0,$FontColor=0,$FontSize=8.5,$FomtWeight=400 _
,$FontAttribute=2,$Fontname="",$FontQuality=2)

$ImageHandle = ResGetImage($ResType,$ResName,$ResLanguage,$ModuleName)
if @error Then Return SetError(1,0,0)
$ImageType = @extended

$ControlID = CtrlCreatePicEx($ImageHandle,$ImageType,$L,$T,$W,$H,$Text,$Style, _
$ExStyle,$FontColor,$FontSize,$FomtWeight,$FontAttribute,$Fontname,$FontQuality)
if @error Then Return SetError(2,0,0)

Return SetError(0,$ImageType,$ControlID)

EndFunc

Func ResCtrlCreate_Button($L,$T,$W,$H,$ResType,$ResName, _
$ResLanguage = -1,$ModuleName = "",$Style = 0,$ExStyle = 0,$ReSize = False)

$ImageHandle = ResGetImage($ResType,$ResName,$ResLanguage,$ModuleName)
if @error Then Return SetError(1,0,0)
$ImageType = @extended

if ($ReSize) Then
$SizeArray = GetImageSize($ImageHandle)
if @error Then
DeleteObj($ImageHandle,$ImageType)
Return SetError(2,0,0)
EndIf
$W = $SizeArray[0]
$H = $SizeArray[1]
EndIf

$ControlID = CtrlCreate_Button($ImageHandle,$ImageType,$L,$T,$W,$H,$Style,$ExStyle)
if @error Then Return SetError(3,0,0)

Return SetError(0,$ImageType,$ControlID)

EndFunc

Func ResSetBackGroundBmp($hWnd,$ResType,$ResName,$ResLanguage = -1 _
,$ModuleName = "",$DeletOldImage = True)

$hImage = ResGetImage($ResType,$ResName,$ResLanguage,$ModuleName)
if @error Then Return SetError(1,0,False)
Local $ImageType = @extended
if ($ImageType <> 1) Then DeleteObj($hImage,$ImageType)

$SizeArray = GetImageSize($hImage)
if @error Then
DeleteObj($hImage,$ImageType)
Return SetError(2,0,False)
EndIf
$BmpWidth = $SizeArray[0]
$BmpHeight = $SizeArray[1]

SetBackGroundBmp($hWnd,$hImage,$BmpWidth,$BmpHeight,$DeletOldImage)
if @error Then
DeleteObj($hImage,$ImageType)
Return SetError(3,0,False)
EndIf

Return SetError(0,0,True)

EndFunc

Func ResSndPlaySound($ResType,$ResName,$ResLanguage = -1,$ModuleName = "",$LOOP = False)
$ByteStruct = ResGet($ResType,$ResName,$ResLanguage,$ModuleName)
if @error Then Return SetError(1,0,False)
$LPVOID = DllStructGetPtr($ByteStruct)
SndPlaySound($LPVOID,$LOOP)
if @error Then Return SetError(2,0,False)
Return SetError(0,0,True)
EndFunc

Func CtrlCreatePic($ImageHandle,$ImageType,$L,$T,$W,$H,$Style = 0,$ExStyle = 0)

Local $SS_ICON_RES = 0x00000003,$SS_ENHMETAFILE_RES = 0x0000000F
Local $SS_BITMAP_RES = 0x0000000E,$SS_REALSIZECONTROL_RES = 0x00000040

Switch $ImageType
Case 1 ;BITMAP
$ImageStyle = BitOR($Style,$SS_BITMAP_RES,$SS_REALSIZECONTROL_RES)
Case 4 ;ENHMETAFILE
$ImageStyle = BitOR($Style,$SS_ENHMETAFILE_RES,$SS_REALSIZECONTROL_RES)
Case 3,5 ;INCON OR CURSOR
$ImageStyle = BitOR($Style,$SS_ICON_RES,$SS_REALSIZECONTROL_RES)
Case Else
Return SetError(1,0,0)
EndSwitch

$ControlID = GUICtrlCreateLabel("",$L,$T,$W,$H,$ImageStyle,$ExStyle)
CtrlSetImage($ControlID,$ImageHandle,$ImageType)
if @error Then Return SetError(2,0,0)
Return SetError(0,$ImageType,$ControlID)

EndFunc

Func CtrlCreatePicEx($ImageHandle,$ImageType,$L,$T,$W,$H,$Text,$Style = 0,$ExStyle = 0, _
$FontColor=0,$FontSize=8.5,$FomtWeight=400,$FontAttribute=0,$Fontname="",$FontQuality=2)

Local $SS_BITMAP_RES = 0x0000000E,$SS_REALSIZECONTROL_RES = 0x00000040
Local $SS_ICON_RES = 0x00000003,$SS_CENTER_RES = 0x01,$SS_CENTERIMAGE_RES = 0x0200
Local $SS_ENHMETAFILE_RES = 0x0000000F

Switch $ImageType
Case 1 ;BITMAP
$ImageStyle = BitOR($Style,$SS_BITMAP_RES,$SS_REALSIZECONTROL_RES)
Case 4 ;ENHMETAFILE
$ImageStyle = BitOR($Style,$SS_ENHMETAFILE_RES,$SS_REALSIZECONTROL_RES)
Case 3,5 ;INCON OR CURSOR
$ImageStyle = BitOR($Style,$SS_ICON_RES,$SS_REALSIZECONTROL_RES)
Case Else
Return SetError(1,0,0)
EndSwitch

$ControlID1 = GUICtrlCreateLabel("",$L,$T,$W,$H,$ImageStyle,$ExStyle)
CtrlSetImage($ControlID1,$ImageHandle,$ImageType)
if @error Then
GUICtrlDelete($ControlID1)
Return SetError(2,0,0)
EndIf

$ControlID2 = GUICtrlCreateLabel($Text,$L,$T,$W,$H,BitOR($SS_CENTER_RES,$SS_CENTERIMAGE_RES))
GUICtrlSetColor(-1,$FontColor)
GUICtrlSetBkColor(-1,-2);-2 $GUI_BKCOLOR_TRANSPARENT
GUICtrlSetFont(-1,$FontSize,$FomtWeight,$FontAttribute,$Fontname,$FontQuality)
Return SetError(0,$ImageType,$ControlID1)

EndFunc

Func DeletePicEx($ControlID)
GUICtrlDelete($ControlID)
GUICtrlDelete($ControlID + 1)
EndFunc

Func SetPosPicEx($ControlID,$L,$T,$W,$H)
GUICtrlSetPos($ControlID,$L,$T,$W,$H)
GUICtrlSetPos($ControlID + 1,$L,$T,$W,$H)
EndFunc

Func SetStatePicEx($ControlID,$State)
GUICtrlSetState($ControlID,$State)
GUICtrlSetState($ControlID + 1,$State)
EndFunc

Func SetStylePicEx($ControlID,$Style,$ExStyle)
GUICtrlSetStyle($ControlID,$Style,$ExStyle)
EndFunc

Func CtrlCreate_Button($ImageHandle,$ImageType,$L,$T,$W,$H,$Style = 0,$ExStyle = 0)

Local $BS_ICON_RES = 0x0040,$BS_BITMAP_RES = 0x0080

Switch $ImageType
Case 1 ;BITMAP
$ImageStyle = BitOR($Style,$BS_BITMAP_RES)
Case 3 ;ICON
$ImageStyle = BitOR($Style,$BS_ICON_RES)
Case Else
Return SetError(1,0,0)
EndSwitch

$ControlID = GUICtrlCreateButton("",$L,$T,$W,$H,$ImageStyle,$ExStyle)
CtrlSetImage($ControlID,$ImageHandle,$ImageType)
if @error Then Return SetError(2,0,0)
Return SetError(0,$ImageType,$ControlID)

EndFunc

Func CtrlSetImage($ControlID,$ImageHandle,$ImageType,$DeletOldImage = False)

;$ImageType
;$ImageType = 1 ==> BITMAP
;$ImageType = 3 ==> ICON
;$ImageType = 4 ==> ENHMETAFILE
;$ImageType = 5 ==> CURSOR
;$ControlID Of STATIC Control Or Button Control

Local $ControHandle = $ControlID,$STM_SETIMAGE_RES = 0x0172,$IMAGE_ENHMETAFILE_RES = 3
Local $IMAGE_BITMAP_RES = 0,$IMAGE_ICON_RES = 1,$IMAGE_CURSOR_RES = 2 , $RthImage = 0
Local $BM_SETIMAGE_RES = 0xF7

if Not IsHWnd($ControlID) Then $ControHandle = GUICtrlGetHandle($ControlID)
Local $Class = _WinAPI_GetClassName($ControHandle)

Select
Case $Class == "Button"
Switch $ImageType
Case 1 ;BITMAP
if ($DeletOldImage) Then $OldImage = CtrlGetOldImage($ControlID)
Local $OldImageType = @extended
$RthImage = _SendMessage($ControHandle,$BM_SETIMAGE_RES,$IMAGE_BITMAP_RES,$ImageHandle)
if ($DeletOldImage And $OldImage <> $ImageHandle _
And $OldImage) Then DeleteObj($OldImage,$OldImageType)
Case 3 ;ICON
if ($DeletOldImage) Then $OldImage = CtrlGetOldImage($ControlID)
Local $OldImageType = @extended
$RthImage = _SendMessage($ControHandle,$BM_SETIMAGE_RES,$IMAGE_ICON_RES,$ImageHandle)
if ($DeletOldImage And $OldImage <> $ImageHandle _
And $OldImage) Then DeleteObj($OldImage,$OldImageType)
Case Else
Return SetError(3,0,False)
EndSwitch
Case $Class == "Static"
Switch $ImageType
Case 1 ;BITMAP
if ($DeletOldImage) Then $OldImage = CtrlGetOldImage($ControlID)
Local $OldImageType = @extended
$RthImage = _SendMessage($ControHandle,$STM_SETIMAGE_RES,$IMAGE_BITMAP_RES,$ImageHandle)
if ($DeletOldImage And $OldImage <> $ImageHandle _
And $OldImage) Then DeleteObj($OldImage,$OldImageType)
Case 4 ;ENHMETAFILE
if ($DeletOldImage) Then $OldImage = CtrlGetOldImage($ControlID)
Local $OldImageType = @extended
$RthImage = _SendMessage($ControHandle,$STM_SETIMAGE_RES,$IMAGE_ENHMETAFILE_RES,$ImageHandle)
if ($DeletOldImage And $OldImage <> $ImageHandle _
And $OldImage) Then DeleteObj($OldImage,$OldImageType)
Case 3 ;ICON
if ($DeletOldImage) Then $OldImage = CtrlGetOldImage($ControlID)
Local $OldImageType = @extended
$RthImage = _SendMessage($ControHandle,$STM_SETIMAGE_RES,$IMAGE_ICON_RES,$ImageHandle)
if ($DeletOldImage And $OldImage <> $ImageHandle _
And $OldImage) Then DeleteObj($OldImage,$OldImageType)
Case 5 ;CURSOR
if ($DeletOldImage) Then $OldImage = CtrlGetOldImage($ControlID)
Local $OldImageType = @extended
$RthImage = _SendMessage($ControHandle,$STM_SETIMAGE_RES,$IMAGE_CURSOR_RES,$ImageHandle)
if ($DeletOldImage And $OldImage <> $ImageHandle _
And $OldImage) Then DeleteObj($OldImage,$OldImageType)
Case Else
Return SetError(3,0,False)
EndSwitch
if IsHWnd($ControlID) Then $ControlID = _WinAPI_GetDlgCtrlID($ControlID)
$ControHandle = GUICtrlGetHandle($ControlID + 1)
if ($ControHandle) Then _WinAPI_RedrawWindow($ControHandle,0,0,$RDW_INVALIDATE)
Case Else
Return SetError(2,0,False)
EndSelect

Return SetError(0,0,True)

EndFunc

Func CtrlGetOldImage($ControlID)

; Return $OldImage Or Zero
;$ImageType = @extended
;$ImageType = 1 ==> BITMAP
;$ImageType = 3 ==> ICON
;$ImageType = 4 ==> ENHMETAFILE
;$ImageType = 5 ==> CURSOR

Local $ControHandle = $ControlID,$STM_GETIMAGE_RES = 0x0173,$IMAGE_ENHMETAFILE_RES = 3
Local $IMAGE_BITMAP_RES = 0,$IMAGE_ICON_RES = 1,$IMAGE_CURSOR_RES = 2 , $OldImage = 0
Local $BM_GETIMAGE_RES  = 0x00F6
if Not IsHWnd($ControlID) Then $ControHandle = GUICtrlGetHandle($ControlID)
Local $Class = _WinAPI_GetClassName($ControHandle)
Select
Case $Class == "Button"
$OldImage = _SendMessage($ControHandle,$BM_GETIMAGE_RES,$IMAGE_BITMAP_RES,0)
if ($OldImage) Then Return SetError(0,1,$OldImage)
$OldImage = _SendMessage($ControHandle,$BM_GETIMAGE_RES,$IMAGE_ICON_RES,0)
if ($OldImage) Then Return SetError(0,3,$OldImage)
Return SetError(1,0,0)
Case $Class == "Static"
$OldImage = _SendMessage($ControHandle,$STM_GETIMAGE_RES,$IMAGE_BITMAP_RES,0)
if ($OldImage) Then Return SetError(0,1,$OldImage)
$OldImage = _SendMessage($ControHandle,$STM_GETIMAGE_RES,$IMAGE_ICON_RES,0)
if ($OldImage) Then Return SetError(0,3,$OldImage)
$OldImage = _SendMessage($ControHandle,$STM_GETIMAGE_RES,$IMAGE_CURSOR_RES,0)
if ($OldImage) Then Return SetError(0,5,$OldImage)
$OldImage = _SendMessage($ControHandle,$STM_GETIMAGE_RES,$IMAGE_ENHMETAFILE_RES,0)
if ($OldImage) Then Return SetError(0,4,$OldImage)
Return SetError(1,0,0)
Case Else
Return SetError(2,0,0)
EndSelect
EndFunc

Func SetBackGroundBmp($hWnd,$hBmpImage,$BmpWidth,$BmpHeight,$DeletOldImage = True)
Local $GuiTest = False , $UBound = UBound($Global_BackGroundArray)
For $i = 0 To $UBound - 1
if ($Global_BackGroundArray[$i][0] = $hWnd) Then
$GuiTest = True
ExitLoop
EndIf
Next
if ($GuiTest = False) Then ReDim $Global_BackGroundArray[$UBound + 1][4]
if ($DeletOldImage) And ($Global_BackGroundArray[$i][1]) _
Then _WinAPI_DeleteObject($Global_BackGroundArray[$i][1])
$Global_BackGroundArray[$i][0] = $hWnd
$Global_BackGroundArray[$i][1] = $hBmpImage
$Global_BackGroundArray[$i][2] = $BmpWidth
$Global_BackGroundArray[$i][3] = $BmpHeight
GUIRegisterMsg($WM_ERASEBKGND,"WM_ERASEBKGND")
_WinAPI_RedrawWindow($hWnd)
EndFunc

Func RemoveBackGroundBmp($hWnd,$DeletImage = True)
Local $GuiTest = False , $UBound = UBound($Global_BackGroundArray)
Local $NewBackGroundArray[$UBound - 1][4]
For $i = 0 To $UBound - 1
if ($Global_BackGroundArray[$i][0] = $hWnd) Then
$GuiTest = True
ExitLoop
EndIf
Next
if ($GuiTest = True) Then
For $i = 0 To $UBound - 1
if ($Global_BackGroundArray[$i][0] = $hWnd) Then ContinueLoop
$NewBackGroundArray[$i][0] = $Global_BackGroundArray[$i][0]
$NewBackGroundArray[$i][1] = $Global_BackGroundArray[$i][1]
$NewBackGroundArray[$i][2] = $Global_BackGroundArray[$i][2]
$NewBackGroundArray[$i][3] = $Global_BackGroundArray[$i][3]
Next
$Global_BackGroundArray = $NewBackGroundArray
Else
Return SetError(1,0,False)
EndIf
_WinAPI_RedrawWindow($hWnd)
Return SetError(0,0,True)
EndFunc

Func WM_ERASEBKGND($hWnd, $Msg, $wParam, $lParam)
Local $GuiTest = False , $UBound = UBound($Global_BackGroundArray)
Local $BGhWnd = WindowFromDC($wParam)
if Not @error Then
For $i = 0 To $UBound - 1
if ($Global_BackGroundArray[$i][0] = $BGhWnd) Then
$GuiTest = True
ExitLoop
EndIf
Next
if ($GuiTest) Then
$Pos = WinGetClientSize($BGhWnd)
$hdc = _WinAPI_CreateCompatibleDC($wParam)
$HGDIOBJ = _WinAPI_SelectObject($hdc,$Global_BackGroundArray[$i][1])
StretchBlt($wParam,0,0,$Pos[0],$Pos[1],$hdc,0,0,$Global_BackGroundArray[$i][2], _
$Global_BackGroundArray[$i][3],$SRCCOPY)
$HGDIOBJ = _WinAPI_SelectObject($hdc,$HGDIOBJ)
_WinAPI_DeleteDC($hdc)
Return True
EndIf
EndIf
EndFunc

Func SndPlaySound($Ptr,$LOOP = False)
;File Type Or Format File.wav
Local $SND_MEMORY  = 4, $SND_ASYNC = 1 ,$SND_SYNC = 0,$SND_NODEFAULT = 2 , _
$SND_LOOP  = 0x0008 , $SND_NOSTOP = 0x0010 ,$SND_FILENAME = 0x00020000
Local $fuSound = BitOR($SND_MEMORY,$SND_ASYNC,$SND_NODEFAULT)
if ($LOOP) Then $fuSound = BitOR($fuSound,$SND_LOOP)
$BOOL = DllCall("winmm.dll", "int", "sndPlaySound","ptr",$Ptr,"UINT",$fuSound)
If @error Or $BOOL[0] = 0 Then Return SetError(1,0,False)
Return SetError(0,0,True)
EndFunc

Func DeleteObj($Object,$ObjectType)
Switch $ObjectType
Case 1
if (_WinAPI_DeleteObject($Object)) Then Return True
Case 2
if (DeleteMetaFile($Object)) Then Return True
Case 3
if (_WinAPI_DestroyIcon($Object)) Then Return True
Case 4
if (DeleteEnhMetaFile($Object)) Then Return True
Case 5
if (DestroyCursor($Object)) Then Return True
EndSwitch
Return SetError(1,0,False)
EndFunc


Func StretchBlt($hdcDest,$nXOriginDest,$nYOriginDest,$nWidthDest,$nHeightDest,$hdcSrc,$nXOriginSrc, _
$nYOriginSrc,$nWidthSrc,$nHeightSrc,$dwRop)
$Rt = DllCall("Gdi32.dll" ,"BOOL","StretchBlt","ptr",$hdcDest,"int",$nXOriginDest,"int",$nYOriginDest,"int",$nWidthDest , _
"int",$nHeightDest,"ptr",$hdcSrc,"int",$nXOriginSrc,"int",$nYOriginSrc,"int",$nWidthSrc,"int",$nHeightSrc,"DWORD",$dwRop)
if @error Or $Rt[0] = 0 Then Return SetError(1,0,0)
Return SetError(0,0,$Rt[0])
EndFunc

Func WindowFromDC($hDC)
$HWND = DllCall("User32.dll","ptr","WindowFromDC","ptr",$hdc)
if @error Or $HWND[0] = 0 Then Return SetError(1,0,0)
Return SetError(0,0,$HWND[0])
EndFunc

Func GetImageSize($hBmp)
Local $ntagBITMAPINFO = "DWORD biSize;LONG biWidth;LONG biHeight;USHORT biPlanes;" & _
"USHORT biBitCount;DWORD biCompression;DWORD biSizeImage;LONG biXPelsPerMeter;" & _
"LONG biYPelsPerMeter;DWORD biClrUsed;DWORD biClrImportant;BYTE RGBQUAD[4]"
Local $vBITMAPINFO = DllStructCreate($ntagBITMAPINFO)
DllStructSetData($vBITMAPINFO,"biSize",(DllStructGetSize($vBITMAPINFO) - 4))
Local $hDC = _WinAPI_CreateCompatibleDC(0)
if Not($hDC) Then
_WinAPI_DeleteDC($hDC)
Return SetError(1,0,0)
EndIf
$Return = _WinAPI_GetDIBits($hDC,$hBmp,0,0,0,DllStructGetPtr($vBITMAPINFO),0)
if Not($Return) Then
_WinAPI_DeleteDC($hDC)
Return SetError(2,0,0)
EndIf
_WinAPI_DeleteDC($hDC)
Local $biWidth = DllStructGetData($vBITMAPINFO,"biWidth")
Local $biHeight = DllStructGetData($vBITMAPINFO,"biHeight")
Local $SizeArray[2]
$SizeArray[0] = $biWidth
$SizeArray[1] = $biHeight
Return $SizeArray
EndFunc

Func DeleteMetaFile($hmf)
$BOOL = DllCall("Gdi32.dll","BOOL","DeleteMetaFile","ptr",$hmf)
if @error Or $BOOL[0] = 0 Then Return SetError(1,0,False)
Return SetError(0,0,True)
EndFunc

Func DeleteEnhMetaFile($hemf)
$BOOL = DllCall("Gdi32.dll","BOOL","DeleteEnhMetaFile","ptr",$hemf)
if @error Or $BOOL[0] = 0 Then Return SetError(1,0,False)
Return SetError(0,0,True)
EndFunc

Func DestroyCursor($hCursor)
$BOOL = DllCall("User32.dll","BOOL","DestroyCursor","ptr",$hCursor)
if @error Or $BOOL[0] = 0 Then Return SetError(1,0,False)
Return SetError(0,0,True)
EndFunc
 

Res_ButtonHover.au3

#include <StaticConstants.au3>
#include "Res_Ctrl.au3"

Global $ButtonHoverStruct = 0 , $TagButtonHoverStruct = "" , $DLLREGISTER = 0
OnAutoItExitRegister("Cleanup")

Func ResCreateButtonHover($hGuiWin,$Text,$L,$T,$W,$H,$TextColor,$BoolFont,$ResType,$ResLanguage=-1,$ModuleName="")

$NormalBmp = ResGetImage($ResType,"NORMAL",$ResLanguage,$ModuleName)
if @error Then Return SetError(1,0,0)
$ImageType1 = @extended
if ($ImageType1 <> 1) Then
DeleteObj($NormalBmp,$ImageType1)
Return SetError(2,0,0)
EndIf

$OverBmp = ResGetImage($ResType,"OVER",$ResLanguage,$ModuleName)
if @error Then Return SetError(3,0,0)
$ImageType2 = @extended
if ($ImageType2 <> 1) Then
DeleteObj($NormalBmp,$ImageType1)
DeleteObj($OverBmp,$ImageType2)
Return SetError(4,0,0)
EndIf

$PressBmp = ResGetImage($ResType,"PRESS",$ResLanguage,$ModuleName)
if @error Then Return SetError(5,0,0)
$ImageType3 = @extended
if ($ImageType3 <> 1) Then
DeleteObj($NormalBmp,$ImageType1)
DeleteObj($OverBmp,$ImageType2)
DeleteObj($PressBmp,$ImageType3)
Return SetError(6,0,0)
EndIf

$USER = CreateButtonHover($hGuiWin,$Text,$L,$T,$W,$H,$NormalBmp,$PressBmp,$OverBmp,$TextColor,$BoolFont)
If @error Then
DeleteObj($NormalBmp,$ImageType1)
DeleteObj($OverBmp,$ImageType2)
DeleteObj($PressBmp,$ImageType3)
Return SetError(7,0,0)
EndIf

Return SetError (0,@extended,$USER)

EndFunc

Func CreateButtonHover($hGuiWin,$Text,$L,$T,$W,$H,$NhBMP,$PhBMP,$OhBMP,$TextColor = 0,$BoolFont = False)
Local $STM_SETIMAGE_HOVER = 0x0172 , $SS_BITMAP_HOVER = 0x0000000E _
, $SS_REALSIZECONTROL_HOVER = 0x00000040 , $iPID_HOVER = 0 , $count = ""

if Not IsDllStruct($ButtonHoverStruct) Then
$hmod = _WinAPI_GetModuleHandle(0)
if Not($hmod) Then Return SetError(1,0,0)
$DLLREGISTER = DllCallbackRegister("ButtonHoverProc","long","int;wparam;lparam")
if Not($DLLREGISTER) Then Return SetError(2,0,0)
$DLLPTR = DllCallbackGetPtr($DLLREGISTER)
$HHOOK = _WinAPI_SetWindowsHookEx($WH_MOUSE,$DLLPTR,$hmod,_WinAPI_GetWindowThreadProcessId($hGuiWin,$iPID_HOVER))
if @error Then
DllCallbackFree($DLLREGISTER)
$DLLREGISTER = 0
Return SetError(3,0,0)
EndIf
EndIf

$controlID1 = GUICtrlCreateLabel("",$L,$T,$W,$H,BitOR($SS_REALSIZECONTROL_HOVER , $SS_BITMAP_HOVER , $SS_NOTIFY))
if Not($controlID1) Then Return SetError(4,0,0)
GUICtrlSetBkColor(-1, -2) ; -2 ==> $GUI_BKCOLOR_TRANSPARENT
$HWNDA = GUICtrlGetHandle($controlID1)
$USER = GUICtrlCreateDummy()
$controlID2 = GUICtrlCreateLabel($Text,$L,$T,$W,$H,BitOR($SS_CENTERIMAGE,$SS_CENTER))
if Not($controlID2) Then
GUICtrlDelete($controlID1)
Return SetError(5,0,0)
EndIf

if ($TextColor) Then GUICtrlSetColor($controlID2,$TextColor)
GUICtrlSetBkColor(-1, -2) ; $GUI_BKCOLOR_TRANSPARENT
if ($BoolFont) Then GUICtrlSetFont($controlID2,(($H / 2) - 1),600,0,"Arial")
$HWNDB = GUICtrlGetHandle($controlID2)

if Not IsDllStruct($ButtonHoverStruct) Then
$count = "1"
$TagButtonHoverStruct = _
"INT COUNT;HANDLE DLLREGISTER;HANDLE HHOOK;INT MOUSEFIRST;INT LBUTTONDOWN;" & _
"HWND HOVER;INT " & String($HWNDA) & ";HWND HWNDA" & $count & ";HWND HWNDB" & $count & _
";INT USER" & $count & ";HANDLE NhBMP" & $count & ";HANDLE PhBMP" & $count & _
";HANDLE OhBMP" & $count
$ButtonHoverStruct = DllStructCreate($TagButtonHoverStruct)
DllStructSetData($ButtonHoverStruct,"COUNT",Int($count))
DllStructSetData($ButtonHoverStruct,String($HWNDA),Int($count))
DllStructSetData($ButtonHoverStruct,"DLLREGISTER",$DLLREGISTER)
DllStructSetData($ButtonHoverStruct,"HHOOK",$HHOOK)
DllStructSetData($ButtonHoverStruct,"MOUSEFIRST",0)
DllStructSetData($ButtonHoverStruct,"LBUTTONDOWN",0)
DllStructSetData($ButtonHoverStruct,"HOVER",0)
Else
Local $count = String(DllStructGetData($ButtonHoverStruct,"COUNT") + 1)
Local $iLength = DllStructGetSize($ButtonHoverStruct)
$TagButtonHoverStruct &= _
";INT " & String($HWNDA) & ";HWND HWNDA" & $count & ";HWND HWNDB" & $count & _
";INT USER" & $count & ";HANDLE NhBMP" & $count & ";HANDLE PhBMP" & $count & _
";HANDLE OhBMP" & $count
$iButtonHoverStruct = DllStructCreate($TagButtonHoverStruct)
DllCall("kernel32.dll","none","RtlMoveMemory","ptr",DllStructGetPtr($iButtonHoverStruct) _
,"ptr",DllStructGetPtr($ButtonHoverStruct),"ulong_ptr",$iLength)
$ButtonHoverStruct = $iButtonHoverStruct
DllStructSetData($ButtonHoverStruct,"COUNT",Int($count))
DllStructSetData($ButtonHoverStruct,String($HWNDA),Int($count))
EndIf

DllStructSetData($ButtonHoverStruct,"HWNDA" & $count,$HWNDA)
DllStructSetData($ButtonHoverStruct,"HWNDB" & $count,$HWNDB)
DllStructSetData($ButtonHoverStruct,"USER"  & $count,$USER)
DllStructSetData($ButtonHoverStruct,"NhBMP" & $count,$NhBMP)
DllStructSetData($ButtonHoverStruct,"PhBMP" & $count,$PhBMP)
DllStructSetData($ButtonHoverStruct,"OhBMP" & $count,$OhBMP)

CtrlSetImage($HWNDA,$NhBMP,1)

Return SetError (0,$controlID2,$USER)

EndFunc

;$controlID ==> Return CreateButtonHover
Func ButtonHoverDelete($controlID)
$HWNDA = GUICtrlGetHandle($controlID - 1)
if Not ($HWNDA) Then Return False
$count = String(DllStructGetData($ButtonHoverStruct,String($HWNDA)))
if Not int($count) Then Return False
$HWNDA = DllStructGetData($ButtonHoverStruct,"HWNDA" & $count)
$HWNDB = DllStructGetData($ButtonHoverStruct,"HWNDB" & $count)
$USER = DllStructGetData($ButtonHoverStruct,"USER" & $count)
$ButtonHoverPtr = DllStructGetPtr($ButtonHoverStruct)
$Size1 = DllStructGetSize($ButtonHoverStruct)
$Size2 = DllStructGetSize( _
DllStructCreate( _
"INT COUNT;HANDLE DLLREGISTER;HANDLE HHOOK;INT MOUSEFIRST;INT LBUTTONDOWN;" & _
"HWND HOVER"))
$Size3 = DllStructGetSize( _
DllStructCreate( _
"INT " & String($HWNDA) & ";HWND HWNDA" & $count & ";HWND HWNDB" & _
$count & ";INT USER" & $count & ";HANDLE NhBMP" & $count & ";HANDLE PhBMP" & $count & _
";HANDLE OhBMP" & $count))
$PriorBeforeCount = (($count - 1) * $Size3) + $Size2
$PriorAfterCount = ($count * $Size3) + $Size2
$TagButtonHoverStruct = StringReplace($TagButtonHoverStruct, _
";INT " & String($HWNDA) & ";HWND HWNDA" & $count & ";HWND HWNDB" & _
$count & ";INT USER" & $count & ";HANDLE NhBMP" & $count & ";HANDLE PhBMP" & $count & _
";HANDLE OhBMP" & $count,"")
$iButtonHoverStruct = DllStructCreate($TagButtonHoverStruct)
$iButtonHoverPtr = DllStructGetPtr($iButtonHoverStruct)
DllCall("kernel32.dll","none","RtlMoveMemory","ptr",$iButtonHoverPtr,"ptr",$ButtonHoverPtr, _
"ulong_ptr",$PriorBeforeCount)
$OutPtrA = DllStructGetPtr($iButtonHoverStruct) + $PriorBeforeCount
$OutPtrB = DllStructGetPtr($ButtonHoverStruct) + $PriorAfterCount
DllCall("kernel32.dll","none","RtlMoveMemory","ptr",$OutPtrA,"ptr",$OutPtrB,"ulong_ptr", _
$Size1 - $PriorAfterCount)
$ButtonHoverStruct = $iButtonHoverStruct
GUICtrlDelete(_WinAPI_GetDlgCtrlID($HWNDA))
GUICtrlDelete(_WinAPI_GetDlgCtrlID($HWNDB))
GUICtrlDelete($USER)
Return True
EndFunc

;$controlID ==> Return CreateButtonHover
Func ButtonHoverSetState($controlID,$ENABLE = 1,$SHOW = 1)
$HWNDA = GUICtrlGetHandle($controlID - 1)
if Not ($HWNDA) Then Return False
$count = String(DllStructGetData($ButtonHoverStruct,String($HWNDA)))
if Not int($count) Then Return False
$HWNDA = DllStructGetData($ButtonHoverStruct,"HWNDA" & $count)
$HWNDB = DllStructGetData($ButtonHoverStruct,"HWNDB" & $count)
_WinAPI_EnableWindow($HWNDA,$ENABLE)
_WinAPI_EnableWindow($HWNDB,$ENABLE)
$uFlags = $SWP_NOMOVE+$SWP_NOSIZE+$SWP_NOZORDER+$SWP_FRAMECHANGED;
if ($SHOW) Then
$uFlags = BitOR($uFlags,$SWP_SHOWWINDOW)
Else
$uFlags = BitOR($uFlags,$SWP_HIDEWINDOW)
EndIf
_WinAPI_SetWindowPos($HWNDA,$HWND_TOP,0,0,0,0,$uFlags)
_WinAPI_SetWindowPos($HWNDB,$HWND_TOP,0,0,0,0,$uFlags)
Return True
EndFunc

;$controlID ==> Return CreateButtonHover
Func ButtonHoverSetPos($controlID,$Left,$Top,$Width,$Height)
$HWNDA = GUICtrlGetHandle($controlID - 1)
if Not ($HWNDA) Then Return False
$count = String(DllStructGetData($ButtonHoverStruct,String($HWNDA)))
if Not int($count) Then Return False
$HWNDA = DllStructGetData($ButtonHoverStruct,"HWNDA" & $count)
$ControlID = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $HWNDA)
If @error Then Return False
$ControlID = $ControlID[0]
GUICtrlSetPos ($controlID,$Left,$Top,$Width,$Height)
$HWNDB = DllStructGetData($ButtonHoverStruct,"HWNDB" & $count)
$ControlID = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $HWNDB)
If @error Then Return False
$ControlID = $ControlID[0]
GUICtrlSetPos ($controlID,$Left,$Top,$Width,$Height)
Return True
EndFunc

Func ButtonHoverProc($nCode, $wParam, $lParam)
$HHOOK = DllStructGetData($ButtonHoverStruct,"HHOOK")
If $nCode < 0 Then _
Return _WinAPI_CallNextHookEx($HHOOK, $nCode, $wParam, $lParam)
Local _
    $WM_MOUSEFIRST_HOVER = 0x0200 , _
    $WM_LBUTTONDOWN_HOVER = 0x0201 , _
    $WM_LBUTTONUP_HOVER = 0x0202 , _
    $STM_SETIMAGE_HOVER = 0x0172 , _
    $Tag_struct ="LONG x;LONG y;HWND hwnd;UINT wHitTestCode;ULONG_PTR dwExtraInfo"
    $MOUSEHOOKSTRUCT = DllStructCreate($Tag_struct,$lParam)
    $hWnd = DllStructGetData($MOUSEHOOKSTRUCT,3)
    $uiMsg = $wParam
    $HOVER = DllStructGetData($ButtonHoverStruct,"HOVER")
    $MOUSEFIRST = DllStructGetData($ButtonHoverStruct,"MOUSEFIRST")
    $LBUTTONDOWN = DllStructGetData($ButtonHoverStruct,"LBUTTONDOWN")
    $count = String(DllStructGetData($ButtonHoverStruct,String($hWnd)))
    if Not ($count == "0") Then
    $HWNDA = DllStructGetData($ButtonHoverStruct,"HWNDA" & $count)
    $HWNDB = DllStructGetData($ButtonHoverStruct,"HWNDB" & $count)
    If $uiMsg = $WM_MOUSEFIRST_HOVER And $MOUSEFIRST = 0 Then
    $OhBMP = DllStructGetData($ButtonHoverStruct,"OhBMP" & $count)
    DllStructSetData($ButtonHoverStruct,"HOVER",$HWNDA)
    CtrlSetImage($HWNDA,$OhBMP,1)
    _WinAPI_RedrawWindow($HWNDB,0,0, $RDW_INVALIDATE )
    DllStructSetData($ButtonHoverStruct,"MOUSEFIRST",1)
    Else
    If $HOVER = $HWNDA Then
    Select
    Case $uiMsg = $WM_LBUTTONDOWN_HOVER And $LBUTTONDOWN = 0
    $PhBMP = DllStructGetData($ButtonHoverStruct,"PhBMP" & $count)
    CtrlSetImage($HWNDA,$PhBMP,1)
    _WinAPI_RedrawWindow($HWNDB,0,0, $RDW_INVALIDATE )
    DllStructSetData($ButtonHoverStruct,"LBUTTONDOWN",1)
    Case $uiMsg = $WM_LBUTTONUP_HOVER And $LBUTTONDOWN = 1
    $OhBMP = DllStructGetData($ButtonHoverStruct,"OhBMP" & $count)
    CtrlSetImage($HWNDA,$OhBMP,1)
    _WinAPI_RedrawWindow($HWNDB,0,0, $RDW_INVALIDATE )
    $USER = DllStructGetData($ButtonHoverStruct,"USER" & $count)
    GUICtrlSendToDummy($USER)
    DllStructSetData($ButtonHoverStruct,"LBUTTONDOWN",0)
    EndSelect
    Else

    If $uiMsg = $WM_LBUTTONUP_HOVER And $LBUTTONDOWN = 1 Then
    $count = String(DllStructGetData($ButtonHoverStruct,String($HOVER)))
    $HWNDA = DllStructGetData($ButtonHoverStruct,"HWNDA" & $count)
    $HWNDB = DllStructGetData($ButtonHoverStruct,"HWNDB" & $count)
    $NhBMP = DllStructGetData($ButtonHoverStruct,"NhBMP" & $count)
    CtrlSetImage($HWNDA,$NhBMP,1)
    _WinAPI_RedrawWindow($HWNDB,0,0, $RDW_INVALIDATE )
    DllStructSetData($ButtonHoverStruct,"LBUTTONDOWN",0)
    $count = String(DllStructGetData($ButtonHoverStruct,String($hWnd)))
    $HWNDA = DllStructGetData($ButtonHoverStruct,"HWNDA" & $count)
    $HWNDB = DllStructGetData($ButtonHoverStruct,"HWNDB" & $count)
    $OhBMP = DllStructGetData($ButtonHoverStruct,"OhBMP" & $count)
    DllStructSetData($ButtonHoverStruct,"HOVER",$HWNDA)
    CtrlSetImage($HWNDA,$OhBMP,1)
    _WinAPI_RedrawWindow($HWNDB,0,0, $RDW_INVALIDATE )
    DllStructSetData($ButtonHoverStruct,"MOUSEFIRST",1)
    EndIf
    EndIf
    EndIf

    Else
    If $LBUTTONDOWN = 1 Then

    If $uiMsg = $WM_LBUTTONUP_HOVER Then
    $count = String(DllStructGetData($ButtonHoverStruct,String($HOVER)))
    $HWNDA = DllStructGetData($ButtonHoverStruct,"HWNDA" & $count)
    $HWNDB = DllStructGetData($ButtonHoverStruct,"HWNDB" & $count)
    $NhBMP = DllStructGetData($ButtonHoverStruct,"NhBMP" & $count)
    CtrlSetImage($HWNDA,$NhBMP,1)
    _WinAPI_RedrawWindow($HWNDB,0,0, $RDW_INVALIDATE )
    DllStructSetData($ButtonHoverStruct,"LBUTTONDOWN",0)
    EndIf

    Else

    If $MOUSEFIRST = 1 Then
    $count = String(DllStructGetData($ButtonHoverStruct,String($HOVER)))
    $HWNDA = DllStructGetData($ButtonHoverStruct,"HWNDA" & $count)
    $HWNDB = DllStructGetData($ButtonHoverStruct,"HWNDB" & $count)
    $NhBMP = DllStructGetData($ButtonHoverStruct,"NhBMP" & $count)
    CtrlSetImage($HWNDA,$NhBMP,1)
    _WinAPI_RedrawWindow($HWNDB,0,0, $RDW_INVALIDATE )
    DllStructSetData($ButtonHoverStruct,"MOUSEFIRST",0)
    EndIf


    EndIf
    EndIf
    Return _WinAPI_CallNextHookEx($HHOOK, $nCode, $wParam, $lParam)
 EndFunc

Func Cleanup()
if IsDllStruct($ButtonHoverStruct) Then
$HHOOK = DllStructGetData($ButtonHoverStruct,"HHOOK")
if ($HHOOK) Then _WinAPI_UnhookWindowsHookEx($HHOOK)
$DLLREGISTER = DllStructGetData($ButtonHoverStruct,"DLLREGISTER")
if ($DLLREGISTER) Then DllCallbackFree($DLLREGISTER)
EndIf
EndFunc

Example_Module_Res.au3

#include "Res_Ctrl.au3"
#include <WinAPI.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>

MsgBox(0,AddRes(),"Success AddRes")

$Gui = GUICreate("Gui Example",500,500,0,0)
$ClID1 = ResCtrlCreatePicEx(10,10,200,100,"GIF","IMGES","GIF",-1,"Res.Dll",$WS_BORDER,0,0,14,800,0,"MS Sans Serif",2)
$ClID2 = ResCtrlCreatePicEx(295,10,200,100,"BMP","IMGES","BMP",-1,"Res.Dll",$WS_BORDER,0,0,14,800,0,"MS Sans Serif",2)
$ClID3 = ResCtrlCreatePicEx(10,120,200,100,"JPG","IMGES","JPG",-1,"Res.Dll",$WS_BORDER,0,0,14,800,0,"MS Sans Serif",2)
$ClID4 = ResCtrlCreatePicEx(295,120,200,100,"ICO","IMGES","ICO",-1,"Res.Dll",$WS_BORDER,0,0,14,800,0,"MS Sans Serif",2)
$ClID5 = ResCtrlCreatePicEx(10,230,480,160,"EMF","IMGES","EMF",-1,"Res.Dll",$WS_BORDER,0,0,14,800,0,"MS Sans Serif",2)
$ClID6 = ResCtrlCreate_Button(214,100,-1,-1,"IMGES","BUTTON",-1,"Res.Dll",0,0,True)
;$W = -1 $H = -1 // $ReSize = True
$BOOL = ResSetBackGroundBmp($Gui,"IMGES","BKGND",-1,"Res.Dll")
$BOOL = ResSndPlaySound("IMGES","WAV",-1,"Res.Dll",True); LOOP = True
GUICtrlCreateLabel(ResGetString("STR","ANSI",-1,False,"Res.Dll"),10,400,480,40,BitOR($WS_BORDER,$SS_CENTER,$SS_CENTERIMAGE))
GUICtrlCreateLabel(ResGetString("STR","UNICODE",-1,True,"Res.Dll"),10,450,480,40,BitOR($WS_BORDER,$SS_CENTER,$SS_CENTERIMAGE))
GUISetState()

Do
$msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE

Func FileToByteStruct($FileName)
Local $nBytes
$FileSize = FileGetSize($FileName)
$FileStruct = DllStructCreate("byte[" & $FileSize & "]")
if @error Then Return SetError(1,0,0)
$hFile = _WinAPI_CreateFile($FileName,2,2)
if Not($hFile) Then Return SetError(2,0,0)
_WinAPI_ReadFile($hFile,DllStructGetPtr($FileStruct),$FileSize,$nBytes)
if @error Then
_WinAPI_CloseHandle($hFile)
Return SetError(3,0,0)
EndIf
_WinAPI_CloseHandle($hFile)
Return SetError(0,0,$FileStruct)
EndFunc

Func AddRes()
if Not FileExists(@ScriptDir & "\Res.Dll") Then FileCopy(@SystemDir & "\ole32.dll",@ScriptDir & "\Res.Dll")
$DataStruct = FileToByteStruct("Gif.gif")
if @error Then Exit(MsgBox(0,"MsgError1","Error ==> " & @error))
UpdateResource("Res.Dll",$DataStruct,"GIF","IMGES")
if @error Then Exit(MsgBox(0,"MsgError2","Error ==> " & @error))
$DataStruct = FileToByteStruct("Bmp.bmp")
if @error Then Exit(MsgBox(0,"MsgError3","Error ==> " & @error))
UpdateResource("Res.Dll",$DataStruct,"BMP","IMGES")
if @error Then Exit(MsgBox(0,"MsgError4","Error ==> " & @error))
$DataStruct = FileToByteStruct("jpg.jpg")
if @error Then Exit(MsgBox(0,"MsgError5","Error ==> " & @error))
UpdateResource("Res.Dll",$DataStruct,"JPG","IMGES")
if @error Then Exit(MsgBox(0,"MsgError6","Error ==> " & @error))
$DataStruct = FileToByteStruct("Ico.ico")
if @error Then Exit(MsgBox(0,"MsgError7","Error ==> " & @error))
UpdateResource("Res.Dll",$DataStruct,"ICO","IMGES")
if @error Then Exit(MsgBox(0,"MsgError8","Error ==> " & @error))
$DataStruct = FileToByteStruct("EMF.EMF")
if @error Then Exit(MsgBox(0,"MsgError9","Error ==> " & @error))
UpdateResource("Res.Dll",$DataStruct,"EMF","IMGES")
if @error Then Exit(MsgBox(0,"MsgError10","Error ==> " & @error))
$DataStruct = FileToByteStruct("BKGND.bmp")
if @error Then Exit(MsgBox(0,"MsgError11","Error ==> " & @error))
UpdateResource("Res.Dll",$DataStruct,"BKGND","IMGES")
if @error Then Exit(MsgBox(0,"MsgError12","Error ==> " & @error))
$DataStruct = FileToByteStruct("Wav.wav")
if @error Then Exit(MsgBox(0,"MsgError13","Error ==> " & @error))
UpdateResource("Res.Dll",$DataStruct,"WAV","IMGES")
if @error Then Exit(MsgBox(0,"MsgError14","Error ==> " & @error))
$DataStruct = DllStructCreate("CHAR[" & StringLen("ANSI String") & "]")
if @error Then Exit(MsgBox(0,"MsgError15","Error ==> " & @error))
DllStructSetData($DataStruct,1,"ANSI String")
UpdateResource("Res.Dll",$DataStruct,"ANSI","STR")
if @error Then Exit(MsgBox(0,"MsgError16","Error ==> " & @error))
$DataStruct = DllStructCreate("WCHAR[" & StringLen("UNICODE Wide Character String") & "]")
if @error Then Exit(MsgBox(0,"MsgError17","Error ==> " & @error))
DllStructSetData($DataStruct,1,"UNICODE Wide Character String")
UpdateResource("Res.Dll",$DataStruct,"UNICODE","STR")
if @error Then Exit(MsgBox(0,"MsgError18","Error ==> " & @error))
$DataStruct = FileToByteStruct("Button.bmp")
if @error Then Exit(MsgBox(0,"MsgError19","Error ==> " & @error))
UpdateResource("Res.Dll",$DataStruct,"BUTTON","IMGES")
if @error Then Exit(MsgBox(0,"MsgError20","Error ==> " & @error))


Return True
EndFunc

Func UpdateResource($Dll_Exe_FileName,$DataStruct,$lpName,$lpType,$wLanguage = 0)
if Not IsDllStruct($DataStruct) Then Return SetError(1,0,False)
Local $lpData = DllStructGetPtr($DataStruct),$cbData = DllStructGetSize($DataStruct)
$HANDLE = DllCall("kernel32.dll","ptr","BeginUpdateResourceW","wstr",$Dll_Exe_FileName,"BOOL",False)
if @error Or $HANDLE[0] = 0 Then Return SetError(2,0,False)
$hUpdate = $HANDLE[0]
if IsString($lpType) Then
$DataType1 = "wstr"
$lpType = StringUpper($lpType)
ELSE
$DataType1 = "long"
EndIf
if IsString($lpName) Then
$DataType2 = "wstr"
$lpName = StringUpper($lpName)
ELSE
$DataType2 = "long"
EndIf
$BOOL = DllCall("kernel32.dll","BOOL","UpdateResourceW","ptr",$hUpdate,$DataType1 _
,$lpType,$DataType2,$lpName,"WORD",$wLanguage,"ptr",$lpData,"DWORD",$cbData)
if @error Or $BOOL[0] = 0 Then Return SetError(3,0,False)
$BOOL = DllCall("kernel32.dll","BOOL","EndUpdateResourceW","HANDLE",$hUpdate,"BOOL",False)
if @error Or $BOOL[0] = 0 Then Return SetError(4,0,False)
Return SetError(0,0,True)
EndFunc
 

Example_Res.au3

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_File_Add=Gif.gif,IMGES,GIF,0
#AutoIt3Wrapper_Res_File_Add=Bmp.bmp,IMGES,BMP,0
#AutoIt3Wrapper_Res_File_Add=jpg.jpg,IMGES,JPG,0
#AutoIt3Wrapper_Res_File_Add=Ico.ico,IMGES,ICO,0
#AutoIt3Wrapper_Res_File_Add=EMF.EMF,IMGES,EMF,0
#AutoIt3Wrapper_Res_File_Add=Button.bmp,IMGES,BUTTON,0
#AutoIt3Wrapper_Res_File_Add=BKGND.bmp,IMGES,BKGND,0
#AutoIt3Wrapper_Res_File_Add=Wav.wav,IMGES,WAV,0
#AutoIt3Wrapper_Res_File_Add=ANSI.txt,STR,ANSI,0
#AutoIt3Wrapper_Res_File_Add=UNICODE.txt,STR,UNICODE,0
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include "Res_Ctrl.au3"
#include <WinAPI.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>

if Not (@Compiled) Then Exit(MsgBox(0,"Err","Must compile the Example_Res.au3 With Options"))

$Gui = GUICreate("Gui Example",500,500,0,0)
$ClID1 = ResCtrlCreatePicEx(10,10,200,100,"GIF","IMGES","GIF",-1,"",$WS_BORDER,0,0,14,800,0,"MS Sans Serif",2)
$ClID2 = ResCtrlCreatePicEx(295,10,200,100,"BMP","IMGES","BMP",-1,"",$WS_BORDER,0,0,14,800,0,"MS Sans Serif",2)
$ClID3 = ResCtrlCreatePicEx(10,120,200,100,"JPG","IMGES","JPG",-1,"",$WS_BORDER,0,0,14,800,0,"MS Sans Serif",2)
$ClID4 = ResCtrlCreatePicEx(295,120,200,100,"ICO","IMGES","ICO",-1,"",$WS_BORDER,0,0,14,800,0,"MS Sans Serif",2)
$ClID5 = ResCtrlCreatePicEx(10,230,480,160,"EMF","IMGES","EMF",-1,"",$WS_BORDER,0,0,14,800,0,"MS Sans Serif",2)
$ClID6 = ResCtrlCreate_Button(214,100,-1,-1,"IMGES","BUTTON",-1,"",0,0,True)
;$W = -1 $H = -1 // $ReSize = True
$BOOL = ResSetBackGroundBmp($Gui,"IMGES","BKGND",-1,"")
$BOOL = ResSndPlaySound("IMGES","WAV",-1,"",True); LOOP = True
GUICtrlCreateLabel(ResGetString("STR","ANSI",-1,False,""),10,400,480,40,BitOR($WS_BORDER,$SS_CENTER,$SS_CENTERIMAGE))
GUICtrlCreateLabel(ResGetString("STR","UNICODE",-1,True,""),10,450,480,40,BitOR($WS_BORDER,$SS_CENTER,$SS_CENTERIMAGE))
GUISetState()

Do
$msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE
 

Example_Module_Res_ButtonHover.au3

#include <WinAPI.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include "Res_ButtonHover.au3"

MsgBox(0,AddRes(),"Success AddRes")

$hGuiWin = GUICreate("Static_ButtonHover")
$Button_A = ResCreateButtonHover($hGuiWin,"ButtonA", 180, 80, 70, 15,0,False,"BUTTON1",-1,"Res.Dll")
GUICtrlSetFont(@extended, 8, 800, 0,  "Arial") ; @extended oR -1
$Button_B = ResCreateButtonHover($hGuiWin,"ButtonB",180, 120, 90, 30,0,False,"BUTTON1",-1,"Res.Dll")
GUICtrlSetFont(-1, 12, 800, 0,  "Arial") ; @extended oR -1
$Button_C = ResCreateButtonHover($hGuiWin,"ButtonC",180, 180, 190, 30,0,False,"BUTTON1",-1,"Res.Dll")
GUICtrlSetFont(@extended, 16, 800, 0,  "Arial") ; @extended oR -1
$Button_D = ResCreateButtonHover($hGuiWin,"ButtonD",180, 240, 190, 60,0,False,"BUTTON1",-1,"Res.Dll")
GUICtrlSetFont(-1, 20, 800, 0,  "Arial") ; @extended oR -1
;$W = -1 $H = -1 // $ReSize = True
$BOOL = ResSetBackGroundBmp($hGuiWin,"IMGES","BKGND",-1,"Res.Dll")
$BOOL = ResSndPlaySound("IMGES","WAV",-1,"Res.Dll",True); LOOP = True
GUISetState()

While 1
$MSG = GUIGetMsg()
Switch $MSG
Case $GUI_EVENT_CLOSE
Exit
Case $Button_A
MsgBox(0,"MSG","Button_A")
Case $Button_B
MsgBox(0,"MSG","Button_B")
Case $Button_C
MsgBox(0,"MSG","Button_C")
Case $Button_D
MsgBox(0,"MSG","Button_D")
EndSwitch
WEnd

Func AddRes()
if Not FileExists(@ScriptDir & "\Res.Dll") Then FileCopy(@SystemDir & "\ole32.dll",@ScriptDir & "\Res.Dll")

;-------------------------------------------------------ButtonHover Images

$DataStruct = FileToByteStruct("Normal.bmp")
if @error Then Exit(MsgBox(0,"MsgError1","Error ==> " & @error))
UpdateResource("Res.Dll",$DataStruct,"NORMAL","BUTTON1")
if @error Then Exit(MsgBox(0,"MsgError2","Error ==> " & @error))

$DataStruct = FileToByteStruct("Press.bmp")
if @error Then Exit(MsgBox(0,"MsgError3","Error ==> " & @error))
UpdateResource("Res.Dll",$DataStruct,"PRESS","BUTTON1")
if @error Then Exit(MsgBox(0,"MsgError4","Error ==> " & @error))

$DataStruct = FileToByteStruct("Over.bmp")
if @error Then Exit(MsgBox(0,"MsgError5","Error ==> " & @error))
UpdateResource("Res.Dll",$DataStruct,"OVER","BUTTON1")
if @error Then Exit(MsgBox(0,"MsgError6","Error ==> " & @error))

; Res Type Is (BUTTON1) Res Names Is ( NORMAL , PRESS , OVER)
;-------------------------------------------------------ButtonHover Images

$DataStruct = FileToByteStruct("BKGND.bmp")
if @error Then Exit(MsgBox(0,"MsgError7","Error ==> " & @error))
UpdateResource("Res.Dll",$DataStruct,"BKGND","IMGES")
if @error Then Exit(MsgBox(0,"MsgError8","Error ==> " & @error))
$DataStruct = FileToByteStruct("Wav.wav")
if @error Then Exit(MsgBox(0,"MsgError9","Error ==> " & @error))
UpdateResource("Res.Dll",$DataStruct,"WAV","IMGES")
if @error Then Exit(MsgBox(0,"MsgError10","Error ==> " & @error))

Return True
EndFunc

Func FileToByteStruct($FileName)
Local $nBytes
$FileSize = FileGetSize($FileName)
$FileStruct = DllStructCreate("byte[" & $FileSize & "]")
if @error Then Return SetError(1,0,0)
$hFile = _WinAPI_CreateFile($FileName,2,2)
if Not($hFile) Then Return SetError(2,0,0)
_WinAPI_ReadFile($hFile,DllStructGetPtr($FileStruct),$FileSize,$nBytes)
if @error Then
_WinAPI_CloseHandle($hFile)
Return SetError(3,0,0)
EndIf
_WinAPI_CloseHandle($hFile)
Return SetError(0,0,$FileStruct)
EndFunc

Func UpdateResource($Dll_Exe_FileName,$DataStruct,$lpName,$lpType,$wLanguage = 0)
if Not IsDllStruct($DataStruct) Then Return SetError(1,0,False)
Local $lpData = DllStructGetPtr($DataStruct),$cbData = DllStructGetSize($DataStruct)
$HANDLE = DllCall("kernel32.dll","ptr","BeginUpdateResourceW","wstr",$Dll_Exe_FileName,"BOOL",False)
if @error Or $HANDLE[0] = 0 Then Return SetError(2,0,False)
$hUpdate = $HANDLE[0]
if IsString($lpType) Then
$DataType1 = "wstr"
$lpType = StringUpper($lpType)
ELSE
$DataType1 = "long"
EndIf
if IsString($lpName) Then
$DataType2 = "wstr"
$lpName = StringUpper($lpName)
ELSE
$DataType2 = "long"
EndIf
$BOOL = DllCall("kernel32.dll","BOOL","UpdateResourceW","ptr",$hUpdate,$DataType1 _
,$lpType,$DataType2,$lpName,"WORD",$wLanguage,"ptr",$lpData,"DWORD",$cbData)
if @error Or $BOOL[0] = 0 Then Return SetError(3,0,False)
$BOOL = DllCall("kernel32.dll","BOOL","EndUpdateResourceW","HANDLE",$hUpdate,"BOOL",False)
if @error Or $BOOL[0] = 0 Then Return SetError(4,0,False)
Return SetError(0,0,True)
EndFunc
 

Example_Res_ButtonHover.au3

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_File_Add=Normal.bmp,BUTTON1,NORMAL,0
#AutoIt3Wrapper_Res_File_Add=Press.bmp,BUTTON1,PRESS,0
#AutoIt3Wrapper_Res_File_Add=Over.bmp,BUTTON1,OVER,0
#AutoIt3Wrapper_Res_File_Add=BKGND.bmp,IMGES,BKGND,0
#AutoIt3Wrapper_Res_File_Add=Wav.wav,IMGES,WAV,0
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

;-------------------------------------------------------ButtonHover Images
; Res Type Is (BUTTON1) Res Names Is ( NORMAL , PRESS , OVER)
;-------------------------------------------------------ButtonHover Images

#include <WinAPI.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include "Res_ButtonHover.au3"

if Not (@Compiled) Then Exit(MsgBox(0,"Err","Must compile the Example_Res_ButtonHover.au3 With Options"))

$hGuiWin = GUICreate("Static_ButtonHover")
$Button_A = ResCreateButtonHover($hGuiWin,"ButtonA", 180, 80, 70, 15,0,False,"BUTTON1",-1)
GUICtrlSetFont(@extended, 8, 800, 0,  "Arial") ; @extended oR -1
$Button_B = ResCreateButtonHover($hGuiWin,"ButtonB",180, 120, 90, 30,0,False,"BUTTON1",-1)
GUICtrlSetFont(-1, 12, 800, 0,  "Arial") ; @extended oR -1
$Button_C = ResCreateButtonHover($hGuiWin,"ButtonC",180, 180, 190, 30,0,False,"BUTTON1",-1)
GUICtrlSetFont(@extended, 16, 800, 0,  "Arial") ; @extended oR -1
$Button_D = ResCreateButtonHover($hGuiWin,"ButtonD",180, 240, 190, 60,0,False,"BUTTON1",-1)
GUICtrlSetFont(-1, 20, 800, 0,  "Arial") ; @extended oR -1
;$W = -1 $H = -1 // $ReSize = True
$BOOL = ResSetBackGroundBmp($hGuiWin,"IMGES","BKGND",-1)
$BOOL = ResSndPlaySound("IMGES","WAV",-1,"",True); LOOP = True
GUISetState()

While 1
$MSG = GUIGetMsg()
Switch $MSG
Case $GUI_EVENT_CLOSE
Exit
Case $Button_A
MsgBox(0,"MSG","Button_A")
Case $Button_B
MsgBox(0,"MSG","Button_B")
Case $Button_C
MsgBox(0,"MSG","Button_C")
Case $Button_D
MsgBox(0,"MSG","Button_D")
EndSwitch
WEnd
 
Edited by wolf9228

صرح السماء كان هنا

 

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  

×