#include <GDIPlus.au3>
#include <Memory.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$SITE_URL = 'http://lacomuna.ru/Awake!/launcher/index.html'
$oIE = ObjCreate("Shell.Explorer.2")
$Form1 = GUICreate("Form1", 586, 384, 205, 77, $WS_POPUP)
$Button = GUICtrlCreatePic('',10,10,32,32)
GUICtrlCreateObj($oIE, 30, 0, 300, 200)
GUICtrlSetResizing(-1,802)
$oIE.navigate($SITE_URL, 0, "", "", "")
_SetImageBinary($Button, InetRead('http://ganibal95.at.ua/Smile/biggrin.gif',1))
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button
MsgBox(0,0,'Кнопка 1')
EndSwitch
WEnd
; --- Это вспомогательные функции их не трогай. ----------
Func _SetImageBinary($CtrlId, ByRef $Binary)
Local $picdata = Binary($Binary)
Local $piclength = BinaryLen($picdata)
Local $picstruct = DllStructCreate("byte[" & $piclength & "]")
DllStructSetData($picstruct,1,$picdata)
Local $picmemory = DllStructGetPtr($picstruct)
_SetMemoryImage($CtrlId, $picmemory, $piclength)
DllStructSetData($picstruct,1,0)
$picstruct = ""
EndFunc
Func _SetMemoryImage($CtrlId, $Pointer, $nSize)
Local $hData, $pData, $pStream, $pBitmap, $hBitmap
$hData = _MemGlobalAlloc($nSize,2)
$pData = _MemGlobalLock($hData)
_MemMoveMemory($Pointer,$pData,$nSize)
_MemGlobalUnlock($hData)
$pStream = DllCall( "ole32.dll","int","CreateStreamOnHGlobal", "int",$hData, "long",1, "Int*",0)
$pStream = $pStream[3]
_GDIPlus_Startup()
$pBitmap = DllCall($ghGDIPDll,"int","GdipCreateBitmapFromStream", "ptr",$pStream, "int*",0)
$pBitmap = $pBitmap[2]
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($pBitmap,0xFF000000)
_SetBitmap($CtrlId, $hBitmap)
If @error Then SetError(3, 0, 0)
_GDIPlus_BitmapDispose($pBitmap)
_GDIPlus_Shutdown()
_WinAPI_DeleteObject($pStream)
_MemGlobalFree($hData)
EndFunc
Func _SetBitmap($CtrlId, $hBitmap)
Local Const $STM_SETIMAGE = 0x0172
Local Const $IMAGE_BITMAP = 0
Local Const $SS_BITMAP = 0xE
Local Const $GWL_STYLE = -16
Local $hWnd = GUICtrlGetHandle($CtrlId)
If $hWnd = 0 Then Return SetError(1, 0, 0)
Local $oldStyle = DllCall("user32.dll", "long", "GetWindowLong", "hwnd", $hWnd, "int", $GWL_STYLE)
If @error Then Return SetError(2, 0, 0)
DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $hWnd, "int", $GWL_STYLE, "long", BitOR($oldStyle[0], $SS_BITMAP))
If @error Then Return SetError(3, 0, 0)
Local $oldBmp = DllCall("user32.dll", "hwnd", "SendMessage", "hwnd", $hWnd, "int", $STM_SETIMAGE, "int", $IMAGE_BITMAP, "int", $hBitmap)
If @error Then Return SetError(4, 0, 0)
If $oldBmp[0] <> 0 Then _WinAPI_DeleteObject($oldBmp[0])
Return 1
EndFunc