根本的な解決にはなっていないかも だが 一応
#uselib "user32.dll"
#cfunc FindWindow "FindWindowExA" int,int,int,int
#func SetParent "SetParent" int,int
#func ShowWindow "ShowWindow" int,int
#func SetWindowLong "SetWindowLongA" int,int,int
#func EnableWindow "EnableWindow" int,int
#func DestroyWindow "DestroyWindow" int
#func MoveWindow "MoveWindow" int,int,int,int,int,int
#func GetWindowRect "GetWindowRect" int,int
exec "notepad.exe"
gsel 0,-1
a=""
b="無題 - メモ帳"
hwnd_= FindWindow(0,0,0,varptr(b))
if hwnd_=0:end
b="EDIT"
hwnd1_= FindWindow(hwnd_,0,varptr(b),0)
dim rect,4
winx=160
;EnableWindow hwnd1_,0
;DestroyWindow hwnd1_
GetWindowRect hwnd1_,varptr(rect)
MoveWindow hwnd1_,winx,0,rect(2)-rect(0)-winx,rect(3)-rect(1),1
bgscr 3,
SetParent hwnd,hwnd_
syscolor 15
boxf
width winx,rect(3)-rect(1),0,0
color
sysfont 17
pos 12,12
objsize 88,21
button "終了",*s
pos ,ginfo_cy+6
mes "これはHSPのウィンドウです。"
pos 6,ginfo_cy+6
objsize winx-6*2,rect(3)-rect(1)-(ginfo_cy+6)-6
str_=""
mesbox str_
stop
*s
MoveWindow hwnd1_,0,0,rect(2)-rect(0),rect(3)-rect(1),1
end