FreeBASIC  0.91.0
io_getxy.c
Go to the documentation of this file.
1 #include "../fb.h"
2 #include "fb_private_console.h"
3 
4 void fb_ConsoleGetRawXYEx( HANDLE hConsole, int *col, int *row )
5 {
6  CONSOLE_SCREEN_BUFFER_INFO info;
7  if( GetConsoleScreenBufferInfo( hConsole, &info ) ) {
8  if( col != NULL )
9  *col = -1;
10  if( row != NULL )
11  *row = -1;
12  } else {
13  if( col != NULL )
14  *col = info.dwCursorPosition.X;
15  if( row != NULL )
16  *row = info.dwCursorPosition.Y;
17  }
18 }
19 
20 void fb_ConsoleGetRawXY( int *col, int *row )
21 {
23 }
24 
25 FBCALL void fb_ConsoleGetXY( int *col, int *row )
26 {
27  CONSOLE_SCREEN_BUFFER_INFO info;
28  if( !GetConsoleScreenBufferInfo( __fb_out_handle, &info ) ) {
29  if( col != NULL )
30  *col = 0;
31  if( row != NULL )
32  *row = 0;
33  } else {
34  if( col != NULL )
35  *col = info.dwCursorPosition.X;
36  if( row != NULL )
37  *row = info.dwCursorPosition.Y;
38  fb_hConvertFromConsole( col, row, NULL, NULL );
39  }
40 }