#include "gdi32.as"
#include "user32.as"
#module holemod
//ウィンドウに穴
//p1:HSPウィンドウID
//p2:穴を開ける位置X
//p3:穴を開ける位置Y
//p4:穴の大きさX
//p5:穴の大きさY
//p6:ウィンドウの枠のサイズを考慮するかどうかのフラグ
#deffunc rgn_hole int p1,int p2,int p3,int p4, int p5, int p6
CreateRectRgn 0,0,0,0:s1 = stat:dim s2,5:GetWindowRect hwnd,varptr(s2):s3=s2.2-s2.0:s4=s2.3-s2.1
CreateRectRgn 0,0,s3,s4:s5= stat:if p6=1{GetSystemMetrics $00000005:s6=stat:pm=SM_CYEDGE
GetSystemMetrics $0000002E:s6+=stat:GetSystemMetrics $00000004:s7=stat}else{s6=0:s7=0}
CreateRectRgn p2+s6,p3+s7+s6,p2+p4+s6,p3+p5+s7+s6:s9= stat:s8=4:CombineRgn s1,s5,s9,s8:SetWindowRgn hwnd,s1,1
DeleteObject s5:DeleteObject s9:DeleteObject s1:return
#global
screen 0,320,240,4
rgn_hole 0,0,0,ginfo_winx,ginfo_winy,1
stop