id = getid(GET_THISUWSC_WIN) st = status(id, st_title); sc = status(id, st_class) id = getid(st, sc) ifb id > 0 then ctrlwin(id,close) exit endif //多重起動防止*/
while true;sleep(1) id = getid(get_active_win) if id < 1 then continue//不要かもしれないけど何となく if status(id, st_icon) then continue//アイコンなら if !status(id, st_visible) then continue//不可視なら //ウィンドウのXY座標、幅と高さ、マウス座標とかを代入。 w = status(id, st_width); h = status(id, st_height)
//解像度に収まるウィンドウならば // if g_screen_w > w and g_screen_h > h then continue //ここはコメントアウトしておいて、とりあえず動作確認。
x = status(id, st_x); y = status(id, st_y) mX = g_mouse_x; mY = g_mouse_y
ifb mX = 0 then//左にマウスがあれば if x < 0 then x = 0 acw(id, x, y)//座標変更 endif
ifb mX + 5 > g_screen_w then//右に if x + w + 1 > g_screen_w then x = g_screen_w - w acw(id, x, y) endif
ifb mY = 0 then//上 if y < 0 then y = 0 acw(id, x, y) endif
ifb mY + 5 > g_screen_h Then//下 if y + h + 1 > g_screen_h then y = g_screen_h - h acw(id, x, y) endif