Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <WinAPI.au3>
- #include <SendMessage.au3>
- $hWnd = GUICreate("Test", 200, 150)
- $cButton = GUICtrlCreateButton("Button", 50, 50, 100, 50)
- GUISetState()
- _SetImage($cButton, @ScriptDir & "\Test.bmp")
- While GUIGetMsg() <> -3
- WEnd
- Func _SetImage($hWnd_Button, $sPath_BMP)
- ; -Author: name22 (www.autoit.de)
- ; -Requires: WinAPI.au3, SendMessage.au3
- If Not IsHWnd($hWnd_Button) Then $hWnd_Button = GUICtrlGetHandle($hWnd_Button)
- Local $hBMP_Button = _WinAPI_LoadImage(0, $sPath_BMP, 0, 0, 0, 0x0010)
- Local $aRet = _SendMessage($hWnd_Button, 0xF7, 0, $hBMP_Button)
- _WinAPI_DeleteObject($hBMP_Button)
- Return $aRet
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement