Что нового

изменить элементы окна

drakulaboy

Новичок
Сообщения
6
Репутация
0
Версия AutoIt: 3.3.14.2

Описание: я увлекаюсь темостроением для Windows 10, люблю тёмные темы и прозрачные, в прозрачных темах есть 2 элемента окна которые не поддаются модификаций, а именно адрес бар и поиск

когда они не в фокусе они прозрачные а когда нажимаю то фон становится чёрный, можно с помощью AutoIt сделать их прозрачными?
Примечания:
я видел где-то такой скрипт, но не знаю как исоользовать его,
Код:
#include <GUIConstants.au3>
#include <windowsconstants.au3>

#region - GUI Create
Global $Topx = 300,$Topy = 400,$extMsg
Global $Plusx = 15, $Plusy = 70
Global $gui1 = GUICreate("Parent GUI", 300, 300, $Topx, $Topy)
GUISetFont(6)
GUICtrlCreatePic("C:\Windows\System32\DefaultAccountTile.png", 0, 0, 300, 300)

GUISetState()
;create layered window so we can have a transparent colour which will be applied to edit background as well as the window
Global $gui2 = GUICreate("child", 200, 250, $Topx + 15,$Topy + 70, $WS_POPUP, BitOR(0x2000000, $WS_EX_LAYERED));$WS_EX_COMPOSITED = 0x2000000
GUICtrlCreateEdit("", 0, 0, 200, 250)
GUICtrlSetFont(-1,16)
GUICtrlSetBkColor(-1, 0xABCDEF);set background to a special colour
$text = FileRead(@ScriptFullPath)
GUICtrlSetData(-1, $text)
_API_SetLayeredWindowAttributes($gui2,0xABCDEF,255);set special colour fully transparent
GUISetState()
winsetontop($gui2,'',1)
GUIRegisterMsg($WM_MOVE,"Follow")
#endregion
WinSetTrans($gui1,"",120)

#region - GUI SelectLoop
While 1
    $extMsg = GUIGetMsg(1)
    $msg = $extMsg[0]
    Switch $extMsg[1]
        Case $gui1
            Select
                Case $msg = $GUI_EVENT_CLOSE
                    Exit

            EndSelect

    EndSwitch
WEnd
#endregion


;===============================================================================
;
; Function Name:   _API_SetLayeredWindowAttributes
; Description:: Sets Layered Window Attributes:) See MSDN for more informaion
; Parameter(s):
;                 $hwnd - Handle of GUI to work on
;                 $i_transcolor - Transparent color
;                 $Transparency - Set Transparancy of GUI
;                 $isColorRef - If True, $i_transcolor is a COLORREF-Strucure, else an RGB-Color
; Requirement(s):  Layered Windows
; Return Value(s): Success: 1
;                 Error: 0
;                  @error: 1 to 3 - Error from DllCall
;                  @error: 4 - Function did not succeed - use
;                              _WinAPI_GetLastErrorMessage or _WinAPI_GetLastError to get more information
; Author(s):       Prog@ndy
;
;===============================================================================
;
Func _API_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $isColorRef = False)

    Local Const $AC_SRC_ALPHA = 1
    Local Const $ULW_ALPHA = 2
    Local Const $LWA_ALPHA = 0x2
    Local Const $LWA_COLORKEY = 0x1
    If Not $isColorRef Then
        $i_transcolor = Hex(String($i_transcolor), 6)
        $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
    EndIf
    Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $LWA_COLORKEY + $LWA_ALPHA)
    Select
        Case @error
            Return SetError(@error, 0, 0)
        Case $Ret[0] = 0
            Return SetError(4, 0, 0)
        Case Else
            Return 1
    EndSelect
EndFunc ;==>_API_SetLayeredWindowAttributes

Func Follow($hWnd)
    Local $wp = WinGetPos($gui1)
    If $hWnd = $gui1 then WinMove($gui2,"",$wp[0] + $Plusx, $wp[1] + $Plusy)

EndFunc

хотел бы знать как можно изменить элементы окна, размер, переместить, добавить кнопки, изображение
 

Вложения

  • 4d855ffe51917c8dc179a6028720e302.jpg
    4d855ffe51917c8dc179a6028720e302.jpg
    91 КБ · Просмотры: 13
  • bb365b072974054b018a9007e3159f98.jpg
    bb365b072974054b018a9007e3159f98.jpg
    105.2 КБ · Просмотры: 16
Автор
drakulaboy

drakulaboy

Новичок
Сообщения
6
Репутация
0
начал выучить английский FAQ, теперь всё понятно, можно удалить пост пожалуйста
 
Верх