
Program TestConsoleCall
       
    Use ifcore
    Use kernel32
    
    TYPE (T_CONSOLE_SCREEN_BUFFER_INFO) :: buffinfo
    TYPE (T_COORD) :: scoord
    integer(HANDLE) ConHandle
    Integer*4 retval
    
    
    ConHandle = GetStdHandle(STD_OUTPUT_HANDLE)  ! Get handle to console
    retval = GetConsoleScreenBufferInfo(ConHandle, buffinfo) ! Get bufferinfo
    
    scoord = buffinfo%dwCursorPosition ! Copy cursor coordinates to seperate structure. 
    
    !Now try call in both both forms:
    
    retval = SetConsoleCursorPosition(ConHandle, buffinfo%dwCursorPosition)
    
    retval = SetConsoleCursorPosition(ConHandle, scoord)
    
       
       
End Program TestConsoleCall