#include-once
#Include <WinAPI.au3>
;~
Global Const $tagBITMAP = "long bmType;long bmWidth;long bmHeight;long
bmWidthBytes;ushort bmPlanes;ushort bmBitsPixel;ptr bmBits;"
Func _WinAPI_UpdateLayeredWindowEx2($hWnd, $iX, $iY, $hBitmap, $iOpacity = 255, $fDelete = 0)
Local $Ret, $tSIZE, $tPOINT, $tBLENDFUNCTION, $hDC, $hDestDC, $hDestSv
$Ret = DllCall('user32.dll', 'hwnd', 'GetDC', 'hwnd', $hWnd)
$hDC = $Ret[0]
$Ret = DllCall('gdi32.dll', 'hwnd', 'CreateCompatibleDC', 'hwnd', $hDC)
$hDestDC = $Ret[0]
$Ret = DllCall('gdi32.dll', 'hwnd', 'SelectObject', 'hwnd', $hDestDC, 'ptr', $hBitmap)
$hDestSv = $Ret[0]
If ($iX = -1) And ($iY = -1) Then
$tPOINT = DllStructCreate('int;int')
Else
$tPOINT = DllStructCreate('int;int;int;int')
EndIf
DllStructSetData($tPOINT, 1, 0)
DllStructSetData($tPOINT, 2, 0)
DllStructSetData($tPOINT, 3, $iX)
DllStructSetData($tPOINT, 4, $iY)
$tBLENDFUNCTION = DllStructCreate($tagBLENDFUNCTION)
DllStructSetData($tBLENDFUNCTION, 1, 0)
DllStructSetData($tBLENDFUNCTION, 2, 0)
DllStructSetData($tBLENDFUNCTION, 3, $iOpacity)
DllStructSetData($tBLENDFUNCTION, 4, 1)
$tSIZE = _WinAPI_GetBitmapDimension2($hBitmap)
$Ret = DllCall('user32.dll', 'int', 'UpdateLayeredWindow',
'hwnd', $hWnd, 'hwnd', $hDC, 'ptr', DllStructGetPtr($tPOINT, 3), 'ptr',
DllStructGetPtr($tSIZE), 'hwnd', $hDestDC, 'ptr',
DllStructGetPtr($tPOINT), 'dword', 0, 'ptr',
DllStructGetPtr($tBLENDFUNCTION), 'dword', 0x02)
DllCall('user32.dll', 'int', 'ReleaseDC', 'hwnd', $hWnd, 'hwnd', $hDC)
DllCall('gdi32.dll', 'ptr', 'SelectObject', 'hwnd', $hDestDC, 'ptr', $hDestSv)
DllCall('gdi32.dll', 'int', 'DeleteDC', 'hwnd', $hDestDC)
If Not $Ret[0] Then
Return SetError(1, 0, 0)
EndIf
If $fDelete Then
_WinAPI_DeleteObject($hBitmap)
EndIf
Return 1
EndFunc ;==>_WinAPI_UpdateLayeredWindowEx
Func _WinAPI_GetBitmapDimension2($hBitmap)
Local $tObj = DllStructCreate($tagBITMAP)
Local $Ret = DllCall('gdi32.dll', 'int', 'GetObject', 'int',
$hBitmap, 'int', DllStructGetSize($tObj), 'ptr', DllStructGetPtr($tObj))
If (@error) Or (Not $Ret[0]) Then
Return SetError(1, 0, 0)
EndIf
Local $tSIZE = DllStructCreate($tagSIZE)
DllStructSetData($tSIZE, 1, DllStructGetData($tObj, 'bmWidth'))
DllStructSetData($tSIZE, 2, DllStructGetData($tObj, 'bmHeight'))
Return $tSIZE
EndFunc ;==>_WinAPI_GetBitmapDimension
Func _WinAPI_CopyBitmap2($hBitmap)
$hBitmap = _WinAPI_CopyImage2($hBitmap, 0, 0, 0, 0x2000)
If @error Then
Return SetError(1, 0, $hBitmap)
EndIf
Return $hBitmap
EndFunc ;==>_WinAPI_CopyBitmap
Func _WinAPI_CopyImage2($hImage, $iType = 0, $xDesired = 0, $yDesired = 0, $iFlags = 0)
Local $Ret = DllCall('user32.dll', 'ptr', 'CopyImage', 'ptr',
$hImage, 'int', $iType, 'int', $xDesired, 'int', $yDesired, 'int',
$iFlags)
If (@error) Or (Not $Ret[0]) Then
Return SetError(1, 0, 0)
EndIf
Return $Ret[0]
EndFunc ;==>_WinAPI_CopyImage
然后 将 自绘窗口_UDF.au3 里相对应的原冲突函数改为上面的函数即可