SetLayeredWindowAttributes= u.api( "SetLayeredWindowAttributes", "bool(addr hwnd,int crKey,int bAlpha,int dwFlags)" );
setOpacity= function(hwnd,alpha){
var style = ( ::GetWindowLong(hwnd,0xFFFFFFEC)) | 0x80000 ;
if( !::SetWindowLong(hwnd,0xFFFFFFEC,style ) ) return;
SetLayeredWindowAttributes(hwnd,0,alpha,2)
}
其中使用了函数SetLayeredWindowAttributes
大部分情况下只会使用整体的透明度修改,如果需要特定颜色的完全透明,可自行查看SetLayeredWindowAttributes