в название темы вся проблема, дополню лишь тем, что кнопки становятся абсолютно черными...
Подскажите в чём проблема и как её исправить?
Код:
#AutoIt3Wrapper_Res_File_Add=image001.bmp, 2, 200
#AutoIt3Wrapper_Res_File_Add=logo.png, PNG, LOGO
#AutoIt3Wrapper_Res_File_Add=Start.png, PNG, Start
#AutoIt3Wrapper_Res_File_Add=Exit.png, PNG, Exit
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GDIPlus.au3>
#Include <Icons.au3>
#Include <WinAPIEx.au3>
Region ### START Koda GUI section ### Form=
$GUI = GUICreate("World of the Rest - Кликер", 339, 169, 194, 114)
$Pic1 = GUICtrlCreatePic("", 0, 0, 339, 168)
GUICtrlSetState(-1, $GUI_DISABLE)
$Pic2 = GUICtrlCreatePic("", 215, 95,120, 70)
GUICtrlSetState(-1, $GUI_DISABLE)
$Login = GUICtrlCreateInput($INILogin, 120, 9, 130, 21, -1, 1)
$Pass = GUICtrlCreateInput($INIPass, 120, 36, 130, 23, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL), 1)
$Host = GUICtrlCreateInput($INIHost, 120, 65, 130, 21, -1, 1)
$Udar = GUICtrlCreateInput($INIUdar, 120, 91, 55, 21, -1, 1)
$Obnovlenie = GUICtrlCreateInput($INIObn, 120, 117, 55, 21, -1, 1)
$ReLogin = GUICtrlCreateInput($INIReLogin, 120, 143, 55, 21, -1, 1)
$IDAptechka = GUICtrlCreateInput($INIAptechka, 260, 143, 74, 21, -1, 1)
$Send = GUICtrlCreateButton("", 260, 9, 74, 51, $BS_BITMAP)
$Exit = GUICtrlCreateButton("", 260, 65, 74, 22, $BS_BITMAP)
$hInstance = _WinAPI_GetModuleHandle(0)
$hBitmap = _WinAPI_LoadBitmap($hInstance, 200)
_SetHImage($Pic1, $hBitmap)
_WinAPI_DeleteObject($hBitmap)
_GDIPlus_Startup()
$hImage = _LoadResourceImage($hInstance, "PNG", "LOGO")
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown()
_SetHImage($Pic2, $hBitmap)
_WinAPI_DeleteObject($hBitmap)
_GDIPlus_Startup()
$hPng = _LoadResourceImage($hInstance, "PNG", "Start")
$hBitmap2 = _GDIPlus_DIBitmapCreateFromBitmap($hPng)
_GDIPlus_ImageDispose($hPng)
$hPng2 = _LoadResourceImage($hInstance, "PNG", "Exit")
$hBitmap3 = _GDIPlus_DIBitmapCreateFromBitmap($hPng2)
_GDIPlus_ImageDispose($hPng2)
_GDIPlus_ShutDown()
;GUICtrlSendMsg(-1, $BM_SETIMAGE, $IMAGE_BITMAP, $hBitmap)
GUICtrlSendMsg($Send, 0x00F7, 0, $hBitmap2)
GUICtrlSendMsg($Exit, 0x00F7, 0, $hBitmap3)
GUISetState()
While 1
Sleep (100)
WEnd
#cs ----------------------------------------------------------------------------
Графические функции
#ce ----------------------------------------------------------------------------
Func _LoadResourceImage($hInstance, $sResType, $sResName, $iResLanguage = 0)
Local $hInfo, $hData, $pData, $iSize, $hMem, $pMem, $hStream, $hImage
If $iResLanguage Then
$hInfo = _WinAPI_FindResourceEx($hInstance, $sResType, $sResName, $iResLanguage)
Else
$hInfo = _WinAPI_FindResource($hInstance, $sResType, $sResName)
EndIf
$hData = _WinAPI_LoadResource($hInstance, $hInfo)
$iSize = _WinAPI_SizeOfResource($hInstance, $hInfo)
$pData = _WinAPI_LockResource($hData)
If @error Then
Return SetError(1, 0, 0)
EndIf
$hMem = DllCall("kernel32.dll", "ptr", "GlobalAlloc", "uint", 2, "ulong_ptr", $iSize)
If @error Then
Return SetError(1, 0, 0)
EndIf
$pMem = DllCall("kernel32.dll", "ptr", "GlobalLock", "ptr", $hMem[0])
If @error Then
Return SetError(1, 0, 0)
EndIf
DllCall("kernel32.dll", "none", "RtlMoveMemory", "ptr", $pMem[0], "ptr", $pData, "ulong_ptr", $iSize)
DllCall("kernel32.dll", "int", "GlobalUnlock", "ptr", $hMem[0])
$hStream = _WinAPI_CreateStreamOnHGlobal($hMem[0])
If @error Then
Return SetError(1, 0, 0)
EndIf
_GDIPlus_Startup()
$hImage = DllCall("gdiplus.dll", "uint", "GdipCreateBitmapFromStream", "ptr", $hStream, "ptr*", 0)
If (@error) Or ($hImage[0]) Or (Not $hImage[2]) Then
$hImage = 0
EndIf
_GDIPlus_Shutdown()
DllCall("kernel32.dll", "ptr", "GlobalFree", "ptr", $hMem[0])
If Not IsArray($hImage) Then
Return SetError(1, 0, 0)
EndIf
Return $hImage[2]
EndFunc ;==>_LoadResourceImage
;################## Button Icon ##################
Do
Until GUIGetMsg() = -3
Func _GDIPlus_DIBitmapCreateFromBitmap($hBitmap)
Local $tBIHDR, $tMap, $pBits, $hImage, $hResult, $Width, $Height
$Width = _GDIPlus_ImageGetWidth($hBitmap)
$Height = _GDIPlus_ImageGetHeight($hBitmap)
If ($Width < 1) Or ($Height < 1) Then
Return 0
EndIf
$hImage = _GDIPlus_BitmapCloneArea($hBitmap, 0, 0, $Width, $Height, $GDIP_PXF32ARGB)
$tMap = _GDIPlus_BitmapLockBits($hImage, 0, 0, $Width, $Height, $GDIP_ILMREAD, $GDIP_PXF32ARGB)
$tBIHDR = DllStructCreate($tagBITMAPINFOHEADER)
DllStructSetData($tBIHDR, 'biSize', DllStructGetSize($tBIHDR))
DllStructSetData($tBIHDR, 'biWidth', $Width)
DllStructSetData($tBIHDR, 'biHeight', $Height)
DllStructSetData($tBIHDR, 'biPlanes', 1)
DllStructSetData($tBIHDR, 'biBitCount', 32)
DllStructSetData($tBIHDR, 'biCompression', $BI_RGB)
$hResult = _WinAPI_CreateDIBSection(0, $tBIHDR, $DIB_RGB_COLORS, $pBits)
If Not @error Then
_WinAPI_SetBitmapBits($hResult, $Width * $Height * 4, DllStructGetData($tMap, 'Scan0'))
EndIf
_GDIPlus_BitmapUnlockBits($hImage, $tMap)
_GDIPlus_BitmapDispose($hImage)
Return $hResult
EndFunc
;################################# End Button Icon ###############################