
    'CALLDLL5.BAS  -  make various API calls to play wave files, track
    'the mouse position, and move a window around

    struct point, x as long, y as long

    open "kernel32" for dll as #kernel
    open "user32" for dll as #user
    open "Me" for window as #aWindow

    hndl = hwnd(#aWindow)

    for i = 1 to 500

        calldll #user, "GetCursorPos", _
            point as struct, _
            result as void

        x = point.x.struct
        y = point.y.struct

        calldll #user, "MoveWindow", _
            hndl as ulong, _
            x as long, _
            y as long, _
            100 as long, _
            100 as long, _
            1 as long, _
            result as boolean

    next i

    progname$ = "notepad.exe call32-5.bas"
    code = _SW_NORMAL

    notice str$(code)

    calldll #kernel, "WinExec", _
        progname$ as struct, _
        code as long, _
        result as long

    print result

    input r$

    close #kernel

    input r$

    'WinConstants
