'編集ウィンドウをファイルバーで選択 / ver. 0.51 / by Kabuneko 2000/05/22
'移動に使うキーは &H30 - &H39 が数字の 0 - 9 ; &H41 - &H5A が英字の A - Z

proc main
    if @hwnd = 0 then exit proc
    dim hwnd[40] as HWND
    dim fbar, ime, i, n, x, key
    fbar = @@PrintFileBar : @@PrintFileBar = 1
    ime = imestatus : imemode 2
    i = 1 : n = 1
    hwnd[i] = @@GetHwnd(2)
    do while 1
        i = i + 1
        hwnd[i] = @@GetHwnd(0)
        if hwnd[i] = 0 then exit do
        x = i
        if @hwnd = hwnd[i] then n = i
    loop
    print "編集ウィンドウ切替中 . . . [RETURN] [SPACE] で決定"
    do while 1
        key = inputkey
        if key = KEY_RETURN or key = KEY_SPACE then
            print "編集ウィンドウ切替 おわり"
            exit do
        elseif key = &H4A or key = KEY_LEFT then      'J または ← で左
            n = n - 1
            if n = 0 then n = x
            @@Activehwnd hwnd[n]
        elseif key = &H4B or key = KEY_RIGHT then     'K または → で右
            n = n + 1
            if n > x then n = 1
            @@Activehwnd hwnd[n]
        end if
        print "編集ウィンドウ切替中 . . . [RETURN] [SPACE] で決定"
    loop
    @@PrintFileBar = fbar : imemode ime
end proc