Войти

Показать полную графическую версию : Прозрачный лэйбл


ShogenOFF
28-07-2010, 23:11
На этом форуме нашел как создать прозрачное окно и прозрачный лэйбл внутри окна. По-одному работают, а вместе нет. А нужно сделать: при запуске скрипта появляется текст с прозрачным фоном. Спасибо.

madmasles
28-07-2010, 23:23
ShogenOFF,
Попробуйте так:#Include (http://www.autoitscript.com/autoit3/docs/keywords.htm##include) <WindowsConstants.au3>
#Include (http://www.autoitscript.com/autoit3/docs/keywords.htm##include) <WinAPI.au3>

$hMain = GUICreate (http://www.autoitscript.com/autoit3/docs/functions/GUICreate.htm)("", 800, 600, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
GUISetBkColor (http://www.autoitscript.com/autoit3/docs/functions/GUISetBkColor.htm)(0xFF0011)
$hOk = GUICtrlCreateButton (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateButton.htm)("OK", 365, 560, 70, 23)
$hLabel = GUICtrlCreateLabel (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateLabel.htm)("Какая-то надпись.", 10, 100, 500, 100)
GUICtrlSetColor (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlSetColor.htm)($hLabel, 0xFF0000)
GUICtrlSetFont (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlSetFont.htm)($hLabel, 32, 800, -1, "Tahoma")

GUISetState (http://www.autoitscript.com/autoit3/docs/functions/GUISetState.htm)()

_WinAPI_SetLayeredWindowAttributes (http://dundats.mvps.org/help/html/libfunctions/_winapi_setlayeredwindowattributes.htm)($hMain, 0xFF0011, 0, $LWA_COLORKEY)

While (http://www.autoitscript.com/autoit3/docs/keywords.htm#While) 1
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) GUIGetMsg (http://www.autoitscript.com/autoit3/docs/functions/GUIGetMsg.htm)() = $hOk Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) Exit (http://www.autoitscript.com/autoit3/docs/keywords.htm#Exit)
WEnd (http://www.autoitscript.com/autoit3/docs/keywords.htm#WEnd)

ShogenOFF
29-07-2010, 15:11
Спасибо...именно это я и хотел...




© OSzone.net 2001-2012