どうぞ。
#include "user32.as"
onexit goto *close // [X]で割り込み
// 親ウィンドウ
screen 0,640,480,0,(ginfo_dispx-640)/2,(ginfo_dispy-512)/2
m_hwnd=hwnd // 親ウィンドウのハンドルを保存
objsize 200,40: pos 16,16: button goto "子ウィンドウを開く",*subwin
stop
*subwin
// 子ウィンドウ
screen 1,320,150,8,(ginfo_dispx-320)/2,(ginfo_dispy-250)/2
s_hwnd=hwnd // 子ウィンドウのハンドルを保存
SetWindowLong hwnd,-8,m_hwnd // 子ウィンドウにする
EnableWindow m_hwnd,0 // 親ウィンドウを無効にする
pos 16,16: mes "これは子ウィンドウです。"
objsize 128,32: pos 100,100: button goto "OK",*subwin_ok
stop
*subwin_ok
gsel 1,-1 // 子ウィンドウを非表示
EnableWindow m_hwnd,1 // 親ウィンドウを有効にする
stop
// [X]の割り込み
*close
if wparam=0 { end } // 親ウィンドウなら終了
goto *subwin_ok // 子ウィンドウ