flat assembler
Message board for the users of flat assembler.
Index
> Windows > Getting the console text attributes |
Author |
|
Picnic 09 Dec 2011, 06:31
|
|||
09 Dec 2011, 06:31 |
|
AsmGuru62 09 Dec 2011, 11:34
You can get some room on stack simply by moving ESP register:
Code: sub esp, sizeof.CONSOLE_SCREEN_BUFFER_INFO mov edi, esp invoke GetConsoleScreenBufferInfo, [hOutput], edi mov ax, [edi + GetConsoleScreenBufferInfo.wAttributes] add esp, sizeof.CONSOLE_SCREEN_BUFFER_INFO |
|||
09 Dec 2011, 11:34 |
|
NanoBytes 11 Dec 2011, 23:23
I decided to do what AsmGuru said and just create the nessesary space for the data. BUT his examplt didnt work, FASM continualy says
Code: Undefined Symbol: esp,sizeof.CONSOLE_SCREEN_BUFFER_INFO The error is refering to the operand of 'sizeof' so I am assuming that I simply did not include a nessesary file _________________ He is no fool who gives what he cannot keep to gain what he cannot loose. |
|||
11 Dec 2011, 23:23 |
|
AsmGuru62 12 Dec 2011, 00:05
Strange... my FASM package does not have the definition of that structure and its components. Here they are:
Code: struct COORD X dw ? Y dw ? ends struct SMALL_RECT Left dw ? Top dw ? Right dw ? Bottom dw ? ends struct CONSOLE_SCREEN_BUFFER_INFO dwSize COORD dwCursorPosition COORD wAttributes dw ? srWindow SMALL_RECT dwMaximumWindowSize COORD ends Put this somewhere in your .INC file(s) and try the code again. |
|||
12 Dec 2011, 00:05 |
|
NanoBytes 12 Dec 2011, 00:21
Perfect, thank you
|
|||
12 Dec 2011, 00:21 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.