#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <WinAPI.au3>
GUIRegisterMsg(0x0115 , "WM_VSCROLL")
$Gui=GUICreate("",300, 300,-1,-1,$WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_CONTROLPARENT))
WinSetTrans($Gui, '', 220)
GUISetBkColor(0xf0d174)
$Button1 = GUICtrlCreateButton("", 55, 72, 75, 28)
$Button2 = GUICtrlCreateButton("", 170, 72, 75, 28, $BS_ICON)
GUICtrlSetImage (-1, "shell32.dll",-132)
$Button1 = GUICtrlCreateInput('', 95, 160, 110, 80)
$slider1 = GUICtrlCreateSlider(135, 80, 30, 70, 0x0002)
GUICtrlSetLimit(-1, 20, 1)
$hSlider_Handle1 = GUICtrlGetHandle(-1)
GUISetState()
; закруглить углы
$pos = WinGetPos($gui)
$rgn = _WinAPI_CreateRoundRectRgn(0, 0, $pos[2], $pos[3], $pos[2], $pos[3])
_WinAPI_SetWindowRgn($gui, $rgn)
While 1
$msg = GUIGetMsg()
Switch $msg
Case $Button2
Exit
EndSwitch
WEnd
Func WM_VSCROLL($hWnd, $Msg, $wParam, $lParam)
#forceref $Msg, $wParam, $lParam
Local $nScrollCode = BitAND($wParam, 0x0000FFFF)
Local $value = BitShift($wParam, 16)
Switch $lParam
Case $hSlider_Handle1
; If $nScrollCode = 5 Then
$rgn = _WinAPI_CreateRoundRectRgn(0, 0, $pos[2], $pos[3], $pos[2]/GUICtrlRead($slider1), $pos[3]/GUICtrlRead($slider1))
_WinAPI_SetWindowRgn($gui, $rgn)
; EndIf
EndSwitch
Return 'GUI_RUNDEFMSG'
EndFunc
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <WinAPI.au3>
$Gui=GUICreate("",300, 300,-1,-1,$WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_CONTROLPARENT))
WinSetTrans($Gui, '', 220)
GUISetBkColor(0xf0d174)
$Button1 = GUICtrlCreateButton("", 55, 72, 75, 28)
$Button2 = GUICtrlCreateButton("", 170, 72, 75, 28, $BS_ICON)
GUICtrlSetImage (-1, "shell32.dll",-132)
$Button1 = GUICtrlCreateInput('', 95, 160, 110, 80)
GUISetState()
; закруглить углы
$pos = WinGetPos($gui)
$rgn = _WinAPI_CreateRoundRectRgn(80, 60, 230, 300, 0, 0) ; квадрат
$rgn1 = _WinAPI_CreateRoundRectRgn(0, 0, 111, 111, 111, 111) ; первый круг
_WinAPI_CombineRgn($rgn, $rgn, $rgn1, $RGN_XOR)
_WinAPI_DeleteObject($rgn1)
$rgn1 = _WinAPI_CreateRoundRectRgn(300, 0, 190, 111, 300, 300) ; второй круг
_WinAPI_CombineRgn($rgn, $rgn, $rgn1, $RGN_OR)
_WinAPI_DeleteObject($rgn1)
$rgn1 = _WinAPI_CreateRoundRectRgn(0, 191, 111, 300, 300, 300) ; третий круг
_WinAPI_CombineRgn($rgn, $rgn, $rgn1, $RGN_DIFF)
_WinAPI_DeleteObject($rgn1)
$rgn1 = _WinAPI_CreateRoundRectRgn(191, 191, 300, 300, 300, 300) ; третий круг
_WinAPI_CombineRgn($rgn, $rgn, $rgn1, $RGN_COPY)
_WinAPI_DeleteObject($rgn1)
_WinAPI_SetWindowRgn($gui, $rgn)
; RGN_AND - только пересекающаяся область
While 1
$msg = GUIGetMsg()
Switch $msg
Case $Button2
Exit
EndSwitch
WEnd
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <WinAPI.au3>
GUIRegisterMsg(0x0115 , "WM_VSCROLL")
$Gui=GUICreate("",600, 600,-1,-1,$WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_CONTROLPARENT))
WinSetTrans($Gui, '', 220)
GUISetBkColor(0xf0d174)
$Button2 = GUICtrlCreateButton("", 300-22, 200-22, 20, 20, $BS_ICON)
GUICtrlSetImage (-1, "shell32.dll",-132)
Global $s1=0, $s2=0, $s3=600, $s4=600, $s5=300, $s6=300
$slider1 = GUICtrlCreateSlider(210, 200, 30, 200, 0x0002)
GUICtrlSetLimit(-1, 600, 1)
$hSlider_Handle1 = GUICtrlGetHandle(-1)
$slider2 = GUICtrlCreateSlider(240, 200, 30, 200, 0x0002)
GUICtrlSetLimit(-1, 600, 1)
$hSlider_Handle2 = GUICtrlGetHandle(-1)
$slider3 = GUICtrlCreateSlider(270, 200, 30, 200, 0x0002)
GUICtrlSetLimit(-1, 600, 1)
GUICtrlSetData(-1, 600)
$hSlider_Handle3 = GUICtrlGetHandle(-1)
$slider4 = GUICtrlCreateSlider(300, 200, 30, 200, 0x0002)
GUICtrlSetLimit(-1, 600, 1)
GUICtrlSetData(-1, 600)
$hSlider_Handle4 = GUICtrlGetHandle(-1)
$slider5 = GUICtrlCreateSlider(330, 200, 30, 200, 0x0002)
GUICtrlSetLimit(-1, 600, 1)
GUICtrlSetData(-1, 300)
$hSlider_Handle5 = GUICtrlGetHandle(-1)
$slider6 = GUICtrlCreateSlider(360, 200, 30, 200, 0x0002)
GUICtrlSetLimit(-1, 600, 1)
GUICtrlSetData(-1, 300)
$hSlider_Handle6 = GUICtrlGetHandle(-1)
GUISetState()
$rgn = _WinAPI_CreateRoundRectRgn(0, 0, 600, 600, 300, 300)
_WinAPI_SetWindowRgn($gui, $rgn)
While 1
$msg = GUIGetMsg()
Switch $msg
Case $Button2
Exit
EndSwitch
WEnd
Func WM_VSCROLL($hWnd, $Msg, $wParam, $lParam)
#forceref $Msg, $wParam, $lParam
Local $nScrollCode = BitAND($wParam, 0x0000FFFF)
Local $value = BitShift($wParam, 16)
Switch $lParam
Case $hSlider_Handle1
If $nScrollCode = 5 Then
$s1=GUICtrlRead($slider1)
EndIf
Case $hSlider_Handle2
If $nScrollCode = 5 Then
$s2=GUICtrlRead($slider2)
EndIf
Case $hSlider_Handle3
If $nScrollCode = 5 Then
$s3=GUICtrlRead($slider3)
EndIf
Case $hSlider_Handle4
If $nScrollCode = 5 Then
$s4=GUICtrlRead($slider4)
EndIf
Case $hSlider_Handle5
If $nScrollCode = 5 Then
$s5=GUICtrlRead($slider5)
EndIf
Case $hSlider_Handle6
If $nScrollCode = 5 Then
$s6=GUICtrlRead($slider6)
EndIf
EndSwitch
$rgn = _WinAPI_CreateRoundRectRgn($s1, $s2, $s3, $s4, $s5, $s6)
_WinAPI_SetWindowRgn($gui, $rgn)
Return 'GUI_RUNDEFMSG'
EndFunc
#Region AutoIt3Wrapper
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_outfile=prog.exe
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, 1.png, PNG, 100,
#AutoIt3Wrapper_Run_After=Upx.exe "%out%" --best --no-backup --overlay=copy --compress-exports=1 --compress-resources=0 --strip-relocs=1
#EndRegion AutoIt3Wrapper
#include <GUIConstants.au3>
#include <EditConstants.au3>
#include <WinAPIEx.au3>
#include <Icons.au3>
$hInstance = _WinAPI_GetModuleHandle(0)
_GDIPlus_Startup()
$hGUI = GUICreate('Title', 500, 400)
$hTop = GUICtrlCreatePic('', 50, 50, 400, 300)
GuiCtrlSetState(-1,$GUI_DISABLE)
_LoadResourceImage($hInstance, 'PNG', 100, $hTop)
$hEdit = GUICtrlCreateEdit('Привет, Arei!', 80, 80, 340, 240, BitOR($ES_AUTOVSCROLL, $ES_WANTRETURN), 0)
GUICtrlSetBkColor(-1, 0x398026)
GUICtrlSetFont(-1, 12, 800, 0, 'Verdana')
GUISetState()
While 1
$hMsg = GUIGetMsg()
Select
Case $hMsg = $GUI_EVENT_CLOSE
Exit
EndSelect
WEnd
Func _LoadResourceImage($hInstance, $sResType, $sResName, $hHndl, $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
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage[2])
_GDIPlus_ImageDispose($hImage[2])
_SetHImage($hHndl, $hBitmap)
_WinAPI_DeleteObject($hBitmap)
;~ Return $hImage[2]
Return 0
EndFunc ;==>_LoadResourceImage
_GDIPlus_Shutdown()
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
$oIE = _IECreateEmbedded()
$html_path = 'about:blank'
;$html_path = @ScriptDir & '\resources\1.html'
$hGUI = GUICreate('11', 480, 640, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MAXIMIZEBOX))
$oIE_ctrl = GUICtrlCreateObj($oIE, 5, 5, 470, 600)
GUICtrlSetResizing($oIE_ctrl, $GUI_DOCKBORDERS)
$hButton1 = GUICtrlCreateButton('Post1', 100, 610, 80, 21)
$hButton2 = GUICtrlCreateButton('Post2', 300, 610, 80, 21)
$null = GUICtrlCreateDummy() ; элемент для отсылки в него блокирующих сочетаний клавиш браузера
Dim $AccelKeys[4][2] = [['{F5}', $null],['^{F5}', $null],['^n', $null],['^p', $null]] ; назначение сочетаний клавиш
GUISetAccelerators($AccelKeys, $hGUI) ; закрепить данные сочетания клавиш
_IENavigate($oIE, $html_path) ; старт браузера из локального файла
$oBody = _IETagNameGetCollection($oIE, 'body', 0) ; сбор body из HTML для дальнейшей вставки в него
_IEHeadInsertEventScript($oIE, 'document', 'oncontextmenu', 'return false') ; скрипт на запрет контекстного меню в браузере
GUISetState()
While 1
$hMsg = GUIGetMsg()
Select
Case $hMsg = $GUI_EVENT_CLOSE
Exit
Case $hMsg = $hButton1
_post(@ScriptDir & '\1.png')
Case $hMsg = $hButton2
_post(@ScriptDir & '\2.png')
EndSelect
WEnd
Func _post($sImage)
$s_string = '<div class="post"><div class="avatar"><img src="' & $sImage & '"></img></div><div class="msg">text text text</div></div>'
_IEDocInsertHTML($oBody, $s_string) ; вставка блока в браузер
_scrollToBottom($oIE) ; прокрутка
EndFunc
Func _scrollToBottom($oIE) ; прокрутка браузера в конец
$sHeight = $oIE.document.body.scrollHeight ; высота скролинга в окне браузера
$oIE.document.parentwindow.scrollTo(0, $sHeight) ; прокрутка
EndFunc ;==>_scrollToBottom
.msg{
background-image: url('back.png');
background-repeat: no-repeat;
}
Взял твое облако, сохранил его как back.png и кинул рядом со скриптом, создал файл 1.html:Спасибо, а облаков нет,т.к css не заполнено?и если да, то как сделать?
$html_path = @ScriptDir & '\1.html'
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="ru,en">
</head>
<style type="text/css">
.msg{
background-image: url('back.png');
background-repeat: no-repeat;
height: 166px;
width: 551px;
padding: 50px 150px;
}</style>
<body>
</body>
</html>