Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
da4146e3
Commit
da4146e3
authored
17 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Use gettextmode() results for screen size rather than hard-coded.
parent
dccc711a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cioxtrn/cioxtrn.c
+195
-185
195 additions, 185 deletions
src/cioxtrn/cioxtrn.c
with
195 additions
and
185 deletions
src/cioxtrn/cioxtrn.c
+
195
−
185
View file @
da4146e3
...
...
@@ -9,6 +9,7 @@ HANDLE console_input;
int
terminate
=
0
;
int
input_thread_running
=
0
;
int
output_thread_running
=
0
;
struct
text_info
ti
;
void
input_thread
(
void
*
args
)
{
...
...
@@ -21,202 +22,206 @@ void input_thread(void *args)
input_thread_running
=
1
;
while
(
!
terminate
)
{
key
=
getch
();
if
(
key
==
0
||
key
==
0xff
)
key
|=
getch
()
<<
8
;
if
(
key
==
1
)
{
if
(
alt
==
0
)
{
alt
=
1
;
ckey
.
Event
.
KeyEvent
.
bKeyDown
=
TRUE
;
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
=
LEFT_ALT_PRESSED
;
}
else
{
alt
=
0
;
ckey
.
Event
.
KeyEvent
.
bKeyDown
=
FALSE
;
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
=
0
;
}
ckey
.
Event
.
KeyEvent
.
wRepeatCount
=
1
;
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_MENU
;
/* ALT key */
ckey
.
Event
.
KeyEvent
.
wVirtualScanCode
=
MapVirtualKey
(
VK_MENU
,
0
);
ckey
.
Event
.
KeyEvent
.
uChar
.
AsciiChar
=
0
;
d
=
0
;
while
(
!
d
)
{
if
(
!
WriteConsoleInput
(
console_input
,
&
ckey
,
1
,
&
d
))
d
=
0
;
}
if
(
alt
)
continue
;
}
if
(
key
<
' '
)
{
/* If this is NOT a "normal" key, fiddle with CTRL */
switch
(
key
)
{
case
8
:
case
9
:
case
10
:
case
13
:
case
27
:
break
;
case
1
:
if
(
alt
==
1
)
break
;
default:
ctrl
=
1
;
ckey
.
Event
.
KeyEvent
.
bKeyDown
=
TRUE
;
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
=
LEFT_CTRL_PRESSED
;
if
(
kbhit
())
{
key
=
getch
();
if
(
key
==
0
||
key
==
0xff
)
key
|=
getch
()
<<
8
;
if
(
key
==
1
)
{
if
(
alt
==
0
)
{
alt
=
1
;
ckey
.
Event
.
KeyEvent
.
bKeyDown
=
TRUE
;
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
=
LEFT_ALT_PRESSED
;
}
else
{
alt
=
0
;
ckey
.
Event
.
KeyEvent
.
bKeyDown
=
FALSE
;
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
=
0
;
}
ckey
.
Event
.
KeyEvent
.
wRepeatCount
=
1
;
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_
CONTROL
;
ckey
.
Event
.
KeyEvent
.
wVirtualScanCode
=
MapVirtualKey
(
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
,
0
);
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_
MENU
;
/* ALT key */
ckey
.
Event
.
KeyEvent
.
wVirtualScanCode
=
MapVirtualKey
(
VK_MENU
,
0
);
ckey
.
Event
.
KeyEvent
.
uChar
.
AsciiChar
=
0
;
d
=
0
;
while
(
!
d
)
{
if
(
!
WriteConsoleInput
(
console_input
,
&
ckey
,
1
,
&
d
))
d
=
0
;
}
if
(
alt
)
continue
;
}
if
(
key
<
' '
)
{
/* If this is NOT a "normal" key, fiddle with CTRL */
switch
(
key
)
{
case
8
:
case
9
:
case
10
:
case
13
:
case
27
:
break
;
case
1
:
if
(
alt
==
1
)
break
;
default:
ctrl
=
1
;
ckey
.
Event
.
KeyEvent
.
bKeyDown
=
TRUE
;
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
=
LEFT_CTRL_PRESSED
;
ckey
.
Event
.
KeyEvent
.
wRepeatCount
=
1
;
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_CONTROL
;
ckey
.
Event
.
KeyEvent
.
wVirtualScanCode
=
MapVirtualKey
(
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
,
0
);
ckey
.
Event
.
KeyEvent
.
uChar
.
AsciiChar
=
0
;
d
=
0
;
while
(
!
d
)
{
if
(
!
WriteConsoleInput
(
console_input
,
&
ckey
,
1
,
&
d
))
d
=
0
;
}
}
}
}
ckey
.
Event
.
KeyEvent
.
bKeyDown
=
TRUE
;
ckey
.
Event
.
KeyEvent
.
wRepeatCount
=
1
;
if
(
key
<
256
)
{
s
=
VkKeyScan
(
key
);
ckey
.
Event
.
KeyEvent
.
bKeyDown
=
TRUE
;
ckey
.
Event
.
KeyEvent
.
wRepeatCount
=
1
;
if
(
key
<
256
)
{
s
=
VkKeyScan
(
key
);
/* No translation */
if
(
s
==-
1
)
continue
;
/* No translation */
if
(
s
==-
1
)
continue
;
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
s
&
0xff
;
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
=
0
;
if
(
s
&
0x0100
)
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
|=
SHIFT_PRESSED
;
if
(
s
&
0x0200
)
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
|=
LEFT_CTRL_PRESSED
;
if
(
s
&
0x0400
)
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
|=
LEFT_ALT_PRESSED
;
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
s
&
0xff
;
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
=
0
;
if
(
s
&
0x0100
)
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
|=
SHIFT_PRESSED
;
if
(
s
&
0x0200
)
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
|=
LEFT_CTRL_PRESSED
;
if
(
s
&
0x0400
)
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
|=
LEFT_ALT_PRESSED
;
ckey
.
Event
.
KeyEvent
.
wVirtualScanCode
=
MapVirtualKey
(
s
&
0xff
,
0
);
ckey
.
Event
.
KeyEvent
.
uChar
.
AsciiChar
=
key
;
}
else
{
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
=
0
;
ckey
.
Event
.
KeyEvent
.
uChar
.
AsciiChar
=
0
;
switch
(
key
)
{
case
CIO_KEY_HOME
:
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_HOME
;
break
;
case
CIO_KEY_UP
:
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_UP
;
break
;
case
CIO_KEY_END
:
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_END
;
break
;
case
CIO_KEY_DOWN
:
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_DOWN
;
break
;
case
CIO_KEY_IC
:
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_INSERT
;
break
;
case
CIO_KEY_DC
:
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_DELETE
;
break
;
case
CIO_KEY_LEFT
:
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_LEFT
;
break
;
case
CIO_KEY_RIGHT
:
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_RIGHT
;
break
;
case
CIO_KEY_PPAGE
:
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_PRIOR
;
break
;
case
CIO_KEY_NPAGE
:
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_NEXT
;
break
;
case
CIO_KEY_F
(
1
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F1
;
break
;
case
CIO_KEY_F
(
2
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F2
;
break
;
case
CIO_KEY_F
(
3
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F3
;
break
;
case
CIO_KEY_F
(
4
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F4
;
break
;
case
CIO_KEY_F
(
5
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F5
;
break
;
case
CIO_KEY_F
(
6
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F6
;
break
;
case
CIO_KEY_F
(
7
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F7
;
break
;
case
CIO_KEY_F
(
8
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F8
;
break
;
case
CIO_KEY_F
(
9
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F9
;
break
;
case
CIO_KEY_F
(
10
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F10
;
break
;
case
CIO_KEY_F
(
11
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F11
;
break
;
case
CIO_KEY_F
(
12
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F12
;
break
;
default:
continue
;
ckey
.
Event
.
KeyEvent
.
wVirtualScanCode
=
MapVirtualKey
(
s
&
0xff
,
0
);
ckey
.
Event
.
KeyEvent
.
uChar
.
AsciiChar
=
key
;
}
ckey
.
Event
.
KeyEvent
.
wRepeatCount
=
1
;
ckey
.
Event
.
KeyEvent
.
wVirtualScanCode
=
MapVirtualKey
(
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
,
0
);
ckey
.
Event
.
KeyEvent
.
uChar
.
AsciiChar
=
0
;
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
=
0
;
}
if
(
alt
)
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
|=
LEFT_ALT_PRESSED
;
else
{
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
=
0
;
ckey
.
Event
.
KeyEvent
.
uChar
.
AsciiChar
=
0
;
switch
(
key
)
{
case
CIO_KEY_HOME
:
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_HOME
;
break
;
case
CIO_KEY_UP
:
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_UP
;
break
;
case
CIO_KEY_END
:
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_END
;
break
;
case
CIO_KEY_DOWN
:
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_DOWN
;
break
;
case
CIO_KEY_IC
:
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_INSERT
;
break
;
case
CIO_KEY_DC
:
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_DELETE
;
break
;
case
CIO_KEY_LEFT
:
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_LEFT
;
break
;
case
CIO_KEY_RIGHT
:
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_RIGHT
;
break
;
case
CIO_KEY_PPAGE
:
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_PRIOR
;
break
;
case
CIO_KEY_NPAGE
:
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_NEXT
;
break
;
case
CIO_KEY_F
(
1
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F1
;
break
;
case
CIO_KEY_F
(
2
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F2
;
break
;
case
CIO_KEY_F
(
3
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F3
;
break
;
case
CIO_KEY_F
(
4
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F4
;
break
;
case
CIO_KEY_F
(
5
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F5
;
break
;
case
CIO_KEY_F
(
6
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F6
;
break
;
case
CIO_KEY_F
(
7
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F7
;
break
;
case
CIO_KEY_F
(
8
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F8
;
break
;
case
CIO_KEY_F
(
9
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F9
;
break
;
case
CIO_KEY_F
(
10
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F10
;
break
;
case
CIO_KEY_F
(
11
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F11
;
break
;
case
CIO_KEY_F
(
12
):
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_F12
;
break
;
default:
continue
;
}
ckey
.
Event
.
KeyEvent
.
wRepeatCount
=
1
;
ckey
.
Event
.
KeyEvent
.
wVirtualScanCode
=
MapVirtualKey
(
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
,
0
);
ckey
.
Event
.
KeyEvent
.
uChar
.
AsciiChar
=
0
;
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
=
0
;
}
if
(
alt
)
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
|=
LEFT_ALT_PRESSED
;
ckey
.
EventType
=
KEY_EVENT
;
d
=
0
;
while
(
!
d
)
{
if
(
!
WriteConsoleInput
(
console_input
,
&
ckey
,
1
,
&
d
))
d
=
0
;
}
ckey
.
Event
.
KeyEvent
.
bKeyDown
=
FALSE
;
d
=
0
;
while
(
!
d
)
{
if
(
!
WriteConsoleInput
(
console_input
,
&
ckey
,
1
,
&
d
))
d
=
0
;
}
if
(
alt
)
{
ckey
.
Event
.
KeyEvent
.
bKeyDown
=
FALSE
;
ckey
.
Event
.
KeyEvent
.
wRepeatCount
=
1
;
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_MENU
;
/* ALT key */
ckey
.
Event
.
KeyEvent
.
wVirtualScanCode
=
MapVirtualKey
(
VK_MENU
,
0
);
ckey
.
Event
.
KeyEvent
.
uChar
.
AsciiChar
=
0
;
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
=
LEFT_ALT_PRESSED
;
ckey
.
EventType
=
KEY_EVENT
;
d
=
0
;
while
(
!
d
)
{
if
(
!
WriteConsoleInput
(
console_input
,
&
ckey
,
1
,
&
d
))
d
=
0
;
}
alt
=
0
;
}
if
(
ctrl
)
{
ckey
.
Event
.
KeyEvent
.
bKeyDown
=
FALSE
;
ckey
.
Event
.
KeyEvent
.
wRepeatCount
=
1
;
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_CONTROL
;
ckey
.
Event
.
KeyEvent
.
wVirtualScanCode
=
MapVirtualKey
(
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
,
0
);
ckey
.
Event
.
KeyEvent
.
uChar
.
AsciiChar
=
0
;
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
=
LEFT_CTRL_PRESSED
;
d
=
0
;
while
(
!
d
)
{
if
(
!
WriteConsoleInput
(
console_input
,
&
ckey
,
1
,
&
d
))
d
=
0
;
}
alt
=
0
;
if
(
alt
)
{
ckey
.
Event
.
KeyEvent
.
bKeyDown
=
FALSE
;
ckey
.
Event
.
KeyEvent
.
wRepeatCount
=
1
;
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_MENU
;
/* ALT key */
ckey
.
Event
.
KeyEvent
.
wVirtualScanCode
=
MapVirtualKey
(
VK_MENU
,
0
);
ckey
.
Event
.
KeyEvent
.
uChar
.
AsciiChar
=
0
;
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
=
LEFT_ALT_PRESSED
;
d
=
0
;
while
(
!
d
)
{
if
(
!
WriteConsoleInput
(
console_input
,
&
ckey
,
1
,
&
d
))
d
=
0
;
}
alt
=
0
;
}
if
(
ctrl
)
{
ckey
.
Event
.
KeyEvent
.
bKeyDown
=
FALSE
;
ckey
.
Event
.
KeyEvent
.
wRepeatCount
=
1
;
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_CONTROL
;
ckey
.
Event
.
KeyEvent
.
wVirtualScanCode
=
MapVirtualKey
(
ckey
.
Event
.
KeyEvent
.
wVirtualKeyCode
,
0
);
ckey
.
Event
.
KeyEvent
.
uChar
.
AsciiChar
=
0
;
ckey
.
Event
.
KeyEvent
.
dwControlKeyState
=
LEFT_CTRL_PRESSED
;
d
=
0
;
while
(
!
d
)
{
if
(
!
WriteConsoleInput
(
console_input
,
&
ckey
,
1
,
&
d
))
d
=
0
;
}
alt
=
0
;
}
}
else
SLEEP
(
1
);
}
input_thread_running
=
0
;
}
...
...
@@ -224,9 +229,9 @@ void input_thread(void *args)
void
output_thread
(
void
*
args
)
{
SMALL_RECT
screen_area
;
CHAR_INFO
from_screen
[
80
*
24
]
;
unsigned
char
write_buf
[
80
*
24
*
2
]
;
unsigned
char
current_screen
[
80
*
24
*
2
]
;
CHAR_INFO
*
from_screen
;
unsigned
char
*
write_buf
;
unsigned
char
*
current_screen
;
CONSOLE_SCREEN_BUFFER_INFO
console_output_info
;
COORD
size
;
COORD
pos
;
...
...
@@ -234,8 +239,12 @@ void output_thread(void *args)
pos
.
X
=
0
;
pos
.
Y
=
0
;
size
.
X
=
80
;
size
.
Y
=
24
;
size
.
X
=
ti
.
screenwidth
;
size
.
Y
=
ti
.
screenheight
;
from_screen
=
(
CHAR_INFO
*
)
malloc
(
sizeof
(
CHAR_INFO
)
*
ti
.
screenheight
*
ti
.
screenwidth
);
write_buf
=
(
unsigned
char
*
)
malloc
(
2
*
ti
.
screenheight
*
ti
.
screenwidth
);
current_screen
=
(
unsigned
char
*
)
malloc
(
2
*
ti
.
screenheight
*
ti
.
screenwidth
);
output_thread_running
=
1
;
while
(
!
terminate
)
{
...
...
@@ -243,22 +252,22 @@ void output_thread(void *args)
/* Read the console screen buffer */
screen_area
.
Left
=
0
;
screen_area
.
Right
=
79
;
screen_area
.
Right
=
ti
.
screenwidth
-
1
;
screen_area
.
Top
=
0
;
screen_area
.
Bottom
=
23
;
screen_area
.
Bottom
=
ti
.
screenheight
-
1
;
ReadConsoleOutput
(
console_output
,
from_screen
,
size
,
pos
,
&
screen_area
);
/* Translate to a ciolib buffer */
j
=
0
;
for
(
i
=
0
;
i
<
sizeof
(
from_screen
)
/
sizeof
(
CHAR_INFO
)
;
i
++
)
{
for
(
i
=
0
;
i
<
ti
.
screenwidth
*
ti
.
screenheight
;
i
++
)
{
write_buf
[
j
++
]
=
from_screen
[
i
].
Char
.
AsciiChar
;
write_buf
[
j
++
]
=
from_screen
[
i
].
Attributes
&
0xff
;
}
/* Compare against the current screen */
gettext
(
1
,
1
,
80
,
24
,
current_screen
);
if
(
memcmp
(
current_screen
,
write_buf
,
sizeof
(
write_buf
)
))
puttext
(
1
,
1
,
80
,
24
,
write_buf
);
gettext
(
1
,
1
,
ti
.
screenwidth
,
ti
.
screenheight
,
current_screen
);
if
(
memcmp
(
current_screen
,
write_buf
,
2
*
ti
.
screenwidth
*
ti
.
screenheight
))
puttext
(
1
,
1
,
ti
.
screenwidth
,
ti
.
screenheight
,
write_buf
);
/* Update cursor position */
if
(
GetConsoleScreenBufferInfo
(
console_output
,
&
console_output_info
))
...
...
@@ -278,6 +287,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE pinst, char *cmd, int cshow)
SECURITY_ATTRIBUTES
sec_attrib
;
initciolib
(
CIOLIB_MODE_ANSI
);
gettextinfo
(
&
ti
);
FreeConsole
();
if
(
!
AllocConsole
())
...
...
@@ -298,12 +308,12 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE pinst, char *cmd, int cshow)
return
(
1
);
}
size
.
X
=
80
;
size
.
Y
=
24
;
size
.
X
=
ti
.
screenwidth
;
size
.
Y
=
ti
.
screenheight
;
screen_area
.
Left
=
0
;
screen_area
.
Right
=
79
;
screen_area
.
Right
=
size
.
X
-
1
;
screen_area
.
Top
=
0
;
screen_area
.
Bottom
=
23
;
screen_area
.
Bottom
=
size
.
Y
-
1
;
SetConsoleCP
(
437
);
SetConsoleOutputCP
(
437
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment