レイヤードウィンドウですが、可能なのは「特定の色を完全に透過する」か
「ウィンドウ全体を透過度指定で半透明にする」かの二択で、
両方を同時に行うことはできないようです。
妥協策ですが、透過色で上半分をスクリーントーンのようなもので塗りつぶし、
擬似的に半透明を表現するというのはどうでしょうか。
#include "user32.as"
#const WS_EX_LAYERED 0x80000
#const LWA_COLORKEY 0x1
#define ctype colorref(%1,%2,%3) ((%1) | ((%2)<<8) | ((%3)<<16))
#module
//tone p1,p2,p3,p4,p5,p6
//現在の色で、スクリーントーン状の塗りつぶしを行う
//p1 : 左上のx座標
//p2 : 左上のy座標
//p3 : 横幅
//p4 : 縦幅
//p5(8) : トーンの濃度。0〜16で指定。省略可能(省略時は8)
//p6(1) : 0以外を指定した時は自動的にredraw 1を行う。省略可能(省略時は1)
#define global tone(%1,%2,%3,%4,%5=8,%6=1) _tone %1,%2,%3,%4,%5,%6
#deffunc _tone int x,int _y,int _w,int _h,int d,int redr
w=limit(_w,0) : h=limit(_h,0)
//bayerマトリクス
dim bayer,4,4
bayer(0,0)= 0, 8, 2,10
bayer(0,1)=12, 4,14, 6
bayer(0,2)= 3,11, 1, 9
bayer(0,3)=15, 7,13, 5
mref vram,66 //psetは遅いのでVRAMに直接書き込み
b=ginfo_b : g=ginfo_g : r=ginfo_r
y=ginfo_sy-(_y+h) //VRAMではy座標が上下逆になる
v_wid=((ginfo_sx)*3+3)&0xFFFFFFFC
repeat h,y
cnt0=cnt
if cnt0>=ginfo_sy : break
v_bas=v_wid*cnt0
repeat w,x
if cnt>=ginfo_sx : break
if d>bayer(cnt\4,cnt0\4) {
v_pos=v_bas+cnt*3
poke vram,v_pos,b
poke vram,v_pos+1,g
poke vram,v_pos+2,r
}
loop
loop
if redr : redraw 1,x,_y,w,h
return
#global
color 0,128,0 : boxf
GetWindowLong hwnd,-20 //拡張ウィンドウスタイルを取得
SetWindowLong hwnd,-20,stat|WS_EX_LAYERED //レイヤードウィンドウにする
crkey=colorref(255,0,255) //透過色を指定
SetLayeredWindowAttributes hwnd,crkey,0,LWA_COLORKEY
color 255,0,255
tone 0,0,640,240