flat assembler
Message board for the users of flat assembler.

Index > Windows > How to save and restore complete console state?

Author
Thread Post new topic Reply to topic
CandyMan



Joined: 04 Sep 2009
Posts: 413
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan 23 Aug 2018, 07:21
How to save and restore complete console state? I mean all data (position the appearance and the window size, content of the buffer etc.). So that after a close-down everything is like before the starting.

_________________
smaller is better
Post 23 Aug 2018, 07:21
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1391
Location: Piraeus, Greece
Picnic 23 Aug 2018, 10:45
Hi CandyMan,

You have to gather all the available console information first.

GetConsoleScreenBufferInfo
GetConsoleCursorInfo
GetConsoleMode
GetConsoleCP
etc

Create your own active console (optionally).

CreateConsoleScreenBuffer
SetConsoleActiveScreenBuffer
SetConsoleMode
SetConsoleCP
etc

Restore the original console information on exit.

SetConsoleActiveScreenBuffer
SetConsoleTextAttribute
SetConsoleCursorInfo
SetConsoleWindowInfo
SetConsoleScreenBufferSize
SetConsoleMode
SetConsoleCP
etc

Hobby Basic does exactly that, it saves and restores complete console state.
Post 23 Aug 2018, 10:45
View user's profile Send private message Visit poster's website Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 413
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan 23 Aug 2018, 15:48
Thanks for the help.
PS. After download and unpacking the Microsoft Security Essentials is detecting the Trojan Horse (Win32/Tiggre!plock) in the file "HB.EXE".

_________________
smaller is better
Post 23 Aug 2018, 15:48
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1391
Location: Piraeus, Greece
Picnic 23 Aug 2018, 19:37
There are some false virus alerts but i'm trying to fix this problem. I think i'm on the right track.
Post 23 Aug 2018, 19:37
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.