mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
CONSOLE_SCREEN_BUFFER_INFO is 22bytes
typedef struct _CONSOLE_SCREEN_BUFFER_INFO { COORD dwSize; // 4(SHORT X, Y) COORD dwCursorPosition; // 4 WORD wAttributes; // 2 SMALL_RECT srWindow; // 8(SHORT Left, Top, Right, Bottom) COORD dwMaximumWindowSize; // 4 } CONSOLE_SCREEN_BUFFER_INFO;
This commit is contained in:
parent
a4a19b114b
commit
b74dd665c0
1 changed files with 2 additions and 2 deletions
|
@ -122,13 +122,13 @@ class Reline::Windows
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.get_screen_size
|
def self.get_screen_size
|
||||||
csbi = 0.chr * 24
|
csbi = 0.chr * 22
|
||||||
@@GetConsoleScreenBufferInfo.call(@@hConsoleHandle, csbi)
|
@@GetConsoleScreenBufferInfo.call(@@hConsoleHandle, csbi)
|
||||||
csbi[0, 4].unpack('SS').reverse
|
csbi[0, 4].unpack('SS').reverse
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.cursor_pos
|
def self.cursor_pos
|
||||||
csbi = 0.chr * 24
|
csbi = 0.chr * 22
|
||||||
@@GetConsoleScreenBufferInfo.call(@@hConsoleHandle, csbi)
|
@@GetConsoleScreenBufferInfo.call(@@hConsoleHandle, csbi)
|
||||||
x = csbi[4, 2].unpack('s*').first
|
x = csbi[4, 2].unpack('s*').first
|
||||||
y = csbi[6, 4].unpack('s*').first
|
y = csbi[6, 4].unpack('s*').first
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue