Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

There is no distinction between any AI program and some existent game.


devel / comp.os.ms-windows.programmer.win32 / Console Window - subclassing (capturing WM_PAINT) : How ?

SubjectAuthor
* Console Window - subclassing (capturing WM_PAINT) : How ?R.Wieser
+* Console Window - subclassing (capturing WM_PAINT) : How ?Paul N
|`- Console Window - subclassing (capturing WM_PAINT) : How ?R.Wieser
+* Console Window - subclassing (capturing WM_PAINT) : How ?JJ
|`* Console Window - subclassing (capturing WM_PAINT) : How ?R.Wieser
| `* Console Window - subclassing (capturing WM_PAINT) : How ?R.Wieser
|  `* Console Window - subclassing (capturing WM_PAINT) : How ?JJ
|   `* Console Window - subclassing (capturing WM_PAINT) : How ?R.Wieser
|    `* Console Window - subclassing (capturing WM_PAINT) : How ?JJ
|     `- Console Window - subclassing (capturing WM_PAINT) : How ?R.Wieser
`* Console Window - subclassing (capturing WM_PAINT) : graphics are possible.R.Wieser
 `* Console Window - subclassing (capturing WM_PAINT) : graphics are possible.JJ
  `* Console Window - subclassing (capturing WM_PAINT) : graphics are possible.R.Wieser
   `* Console Window - subclassing (capturing WM_PAINT) : graphics are possible.JJ
    `- Console Window - subclassing (capturing WM_PAINT) : graphics are possible.R.Wieser

1
Console Window - subclassing (capturing WM_PAINT) : How ?

<tg4c7r$148$1@gioia.aioe.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1103&group=comp.os.ms-windows.programmer.win32#1103

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!XakcSTEO51npqVb7OVl71w.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Console Window - subclassing (capturing WM_PAINT) : How ?
Date: Sat, 17 Sep 2022 13:49:11 +0200
Organization: Aioe.org NNTP Server
Lines: 29
Message-ID: <tg4c7r$148$1@gioia.aioe.org>
Injection-Info: gioia.aioe.org; logging-data="1160"; posting-host="XakcSTEO51npqVb7OVl71w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-MSMail-Priority: Normal
X-Notice: Filtered by postfilter v. 0.9.2
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Priority: 3
X-RFC2646: Format=Flowed; Original
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
 by: R.Wieser - Sat, 17 Sep 2022 11:49 UTC

Hello all,

I'm trying to draw some simple graphics (dots, lines) into a windowed
console.

Although grabbing its DC and use that to draw on works, any updating of the
screen by the running program (partially) causes havoc - from the drawing
being partially erased to it fully disappearing.

So, I'm looking for a way to subclass a console window so I can intercept
its WM_PAINT message, and redraw my stuff after an update of the window
occurs.

The problem is that although I have a hWnd to the console, a
'SetWindowSubclass' fails (incorrect parameter), and a GetWindowLong
GWL_WINPROC returns Zero (whut ?).

This morning I've been searching the intarnetz for information on how to
intercept WM_* messages of a console window, but I've not been able to find
anything in that direction. :-\

Anyone knows how to do it and wants to share ?

Target OS: XPsp3

Regards,
Rudy Wieser

Re: Console Window - subclassing (capturing WM_PAINT) : How ?

<8ab44866-5ab5-4287-b5d7-7993636e8534n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1104&group=comp.os.ms-windows.programmer.win32#1104

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
X-Received: by 2002:ad4:5b8c:0:b0:4ac:b956:8da8 with SMTP id 12-20020ad45b8c000000b004acb9568da8mr9059656qvp.86.1663433241106;
Sat, 17 Sep 2022 09:47:21 -0700 (PDT)
X-Received: by 2002:ac8:5b50:0:b0:344:7c4f:5a89 with SMTP id
n16-20020ac85b50000000b003447c4f5a89mr9087843qtw.472.1663433240925; Sat, 17
Sep 2022 09:47:20 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.ms-windows.programmer.win32
Date: Sat, 17 Sep 2022 09:47:20 -0700 (PDT)
In-Reply-To: <tg4c7r$148$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=89.240.150.163; posting-account=0B-afgoAAABP6274zLUJKa8ZpdIdhsYx
NNTP-Posting-Host: 89.240.150.163
References: <tg4c7r$148$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8ab44866-5ab5-4287-b5d7-7993636e8534n@googlegroups.com>
Subject: Re: Console Window - subclassing (capturing WM_PAINT) : How ?
From: gw7rib@aol.com (Paul N)
Injection-Date: Sat, 17 Sep 2022 16:47:21 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2616
 by: Paul N - Sat, 17 Sep 2022 16:47 UTC

On Saturday, September 17, 2022 at 12:49:20 PM UTC+1, R.Wieser wrote:
> Hello all,
>
> I'm trying to draw some simple graphics (dots, lines) into a windowed
> console.
>
> Although grabbing its DC and use that to draw on works, any updating of the
> screen by the running program (partially) causes havoc - from the drawing
> being partially erased to it fully disappearing.
>
> So, I'm looking for a way to subclass a console window so I can intercept
> its WM_PAINT message, and redraw my stuff after an update of the window
> occurs.
>
> The problem is that although I have a hWnd to the console, a
> 'SetWindowSubclass' fails (incorrect parameter), and a GetWindowLong
> GWL_WINPROC returns Zero (whut ?).
>
> This morning I've been searching the intarnetz for information on how to
> intercept WM_* messages of a console window, but I've not been able to find
> anything in that direction. :-\
>
> Anyone knows how to do it and wants to share ?
>
> Target OS: XPsp3

I thought the basic idea of a console was that you weren't going to do that sort of thing?

I don't know how to do what you want to do, and I'm not even sure if it's possible. A possible way round things though - why don't you have a normal window, with a big multi-line edit box covering some or all of it, and "print" text by adding it to the text in the box?

Re: Console Window - subclassing (capturing WM_PAINT) : How ?

<t9klcuql1tym.19vzjgim4rzxg$.dlg@40tude.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1105&group=comp.os.ms-windows.programmer.win32#1105

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: jj4public@outlook.com (JJ)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console Window - subclassing (capturing WM_PAINT) : How ?
Date: Sun, 18 Sep 2022 13:40:07 +0700
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <t9klcuql1tym.19vzjgim4rzxg$.dlg@40tude.net>
References: <tg4c7r$148$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="31e64046ebcc0a9e031b7c168e1cda64";
logging-data="454456"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1899UykL8GDI07149fFUj7W6CMHiWpsQnI="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:RUczTAQ+JlpLoOQciux0DgvPIZU=
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
 by: JJ - Sun, 18 Sep 2022 06:40 UTC

On Sat, 17 Sep 2022 13:49:11 +0200, R.Wieser wrote:
> Hello all,
>
> I'm trying to draw some simple graphics (dots, lines) into a windowed
> console.
>
> Although grabbing its DC and use that to draw on works, any updating of the
> screen by the running program (partially) causes havoc - from the drawing
> being partially erased to it fully disappearing.
>
> So, I'm looking for a way to subclass a console window so I can intercept
> its WM_PAINT message, and redraw my stuff after an update of the window
> occurs.
>
> The problem is that although I have a hWnd to the console, a
> 'SetWindowSubclass' fails (incorrect parameter), and a GetWindowLong
> GWL_WINPROC returns Zero (whut ?).
>
> This morning I've been searching the intarnetz for information on how to
> intercept WM_* messages of a console window, but I've not been able to find
> anything in that direction. :-\
>
> Anyone knows how to do it and wants to share ?
>
> Target OS: XPsp3
>
> Regards,
> Rudy Wieser

Have you tried using `SetWindowLong()` or `SetClassLong()` instead?

Re: Console Window - subclassing (capturing WM_PAINT) : How ?

<tg6fmd$1duu$1@gioia.aioe.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1106&group=comp.os.ms-windows.programmer.win32#1106

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!XakcSTEO51npqVb7OVl71w.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console Window - subclassing (capturing WM_PAINT) : How ?
Date: Sun, 18 Sep 2022 09:00:26 +0200
Organization: Aioe.org NNTP Server
Lines: 37
Message-ID: <tg6fmd$1duu$1@gioia.aioe.org>
References: <tg4c7r$148$1@gioia.aioe.org> <8ab44866-5ab5-4287-b5d7-7993636e8534n@googlegroups.com>
Injection-Info: gioia.aioe.org; logging-data="47070"; posting-host="XakcSTEO51npqVb7OVl71w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MSMail-Priority: Normal
X-RFC2646: Format=Flowed; Original
X-Notice: Filtered by postfilter v. 0.9.2
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Priority: 3
 by: R.Wieser - Sun, 18 Sep 2022 07:00 UTC

Paul,

> I thought the basic idea of a console was that you weren't going to do
> that sort of thing?

Well ... I've been using graphics in a console windows for years thru QBASIC
(and INT 0x10). Yep, I'm working with/looking at DOS programs there. :-)

The problem is that one of my 'puters has a /very/ basic video card, which
just causes the puter to lockup (needing a hard reset) whenever I now try.
:-(

So, I'm looking for something to keep everything in textmode, but add the
graphics as an "overlay".

> I don't know how to do what you want to do, and I'm not even sure if
> it's possible.

I'm not sure either. But I'm trying different things to see if something
works better than directly drawing to the windows DC (which does work, just
badly).

> A possible way round things though - why don't you have a normal window,
> with a big multi-line edit box covering some or all of it, and "print"
> text by adding it to the text in the box?

That would work if I could redirect all the text output to code I control.
Alas, old DOS programs sometimes (often?) write directly to the text memory
(0xB800 IIRC), which is rather hard to intercept. The above-mentioned
QBASIC program is one of them.

Thanks for the suggestion though.

Regards,
Rudy Wieser

Re: Console Window - subclassing (capturing WM_PAINT) : How ?

<tg77ib$1273$1@gioia.aioe.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1107&group=comp.os.ms-windows.programmer.win32#1107

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!XakcSTEO51npqVb7OVl71w.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console Window - subclassing (capturing WM_PAINT) : How ?
Date: Sun, 18 Sep 2022 15:47:52 +0200
Organization: Aioe.org NNTP Server
Lines: 14
Message-ID: <tg77ib$1273$1@gioia.aioe.org>
References: <tg4c7r$148$1@gioia.aioe.org> <t9klcuql1tym.19vzjgim4rzxg$.dlg@40tude.net>
Injection-Info: gioia.aioe.org; logging-data="35043"; posting-host="XakcSTEO51npqVb7OVl71w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-RFC2646: Format=Flowed; Original
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-Notice: Filtered by postfilter v. 0.9.2
 by: R.Wieser - Sun, 18 Sep 2022 13:47 UTC

JJ,

> Have you tried using `SetWindowLong()` or `SetClassLong()` instead?

Neither. The first because reading the GWLWNDPROC returned zero, and the
second because only want to affect a specific console window, not all of
them.

But you're right, I could at least try to see what happens.

Regards,
Rudy Wieser

Re: Console Window - subclassing (capturing WM_PAINT) : How ?

<tg794n$1pb8$1@gioia.aioe.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1108&group=comp.os.ms-windows.programmer.win32#1108

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!XakcSTEO51npqVb7OVl71w.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console Window - subclassing (capturing WM_PAINT) : How ?
Date: Sun, 18 Sep 2022 16:14:41 +0200
Organization: Aioe.org NNTP Server
Lines: 18
Message-ID: <tg794n$1pb8$1@gioia.aioe.org>
References: <tg4c7r$148$1@gioia.aioe.org> <t9klcuql1tym.19vzjgim4rzxg$.dlg@40tude.net> <tg77ib$1273$1@gioia.aioe.org>
Injection-Info: gioia.aioe.org; logging-data="58728"; posting-host="XakcSTEO51npqVb7OVl71w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Priority: 3
X-RFC2646: Format=Flowed; Response
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-Notice: Filtered by postfilter v. 0.9.2
 by: R.Wieser - Sun, 18 Sep 2022 14:14 UTC

JJ,

[quote=me]
But you're right, I could at least try to see what happens.
[/quote]

Alas, changing either/both doesn't give any kind of different result. No
intercepted messages, nothing throwing a hissy fit either. Its as if I've
done nothing at all.

Worse: changing both GWL_WNDPROC and CWL_WNDPROC and checking them later
shows the same values as before I made the change. IOW, its as if setting
them is ignored.

Regards,
Rudy Wieser

Re: Console Window - subclassing (capturing WM_PAINT) : How ?

<x6anbwufslo.3p26sr0vs9v8.dlg@40tude.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1109&group=comp.os.ms-windows.programmer.win32#1109

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: jj4public@outlook.com (JJ)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console Window - subclassing (capturing WM_PAINT) : How ?
Date: Mon, 19 Sep 2022 15:16:53 +0700
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <x6anbwufslo.3p26sr0vs9v8.dlg@40tude.net>
References: <tg4c7r$148$1@gioia.aioe.org> <t9klcuql1tym.19vzjgim4rzxg$.dlg@40tude.net> <tg77ib$1273$1@gioia.aioe.org> <tg794n$1pb8$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="99521e1f5a48d515c35543b3e2d529a6";
logging-data="1097092"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX192MSvdbMzig9MXaRbe2g91Z9S7uAQJSyk="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:8Zi6GYFRCI7BC2JExOL9nH0lpnw=
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
 by: JJ - Mon, 19 Sep 2022 08:16 UTC

On Sun, 18 Sep 2022 16:14:41 +0200, R.Wieser wrote:
>
> Alas, changing either/both doesn't give any kind of different result. No
> intercepted messages, nothing throwing a hissy fit either. Its as if I've
> done nothing at all.
>
> Worse: changing both GWL_WNDPROC and CWL_WNDPROC and checking them later
> shows the same values as before I made the change. IOW, its as if setting
> them is ignored.

I think the system has an unconditional hardcoded protection for console
window message handler, since GetWindowLong returns zero with an access
denied error code when the console application is run using the SYSTEM
account. Weirdly, if the console application is not run using the SYSTEM
account, GetWindowLong returns a kernel-space pointer (e.g. 0xFFFF0501) with
a success error code.

This conclusion is based on the fact that, an application run using the
SYSTEM account can terminate CSRSS.EXE and BSOD-ed the system. So, if it
can't subclass the console window, it should mean that, the system has
prevented it unconditionally - regardless of user credentials and
privileges. Because IMO, it's unbelievable to think that a console window
message handler is more crucial than CSRSS.EXE.

Re: Console Window - subclassing (capturing WM_PAINT) : How ?

<tg9e58$uhf$1@gioia.aioe.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1110&group=comp.os.ms-windows.programmer.win32#1110

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!XakcSTEO51npqVb7OVl71w.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console Window - subclassing (capturing WM_PAINT) : How ?
Date: Mon, 19 Sep 2022 11:52:36 +0200
Organization: Aioe.org NNTP Server
Lines: 37
Message-ID: <tg9e58$uhf$1@gioia.aioe.org>
References: <tg4c7r$148$1@gioia.aioe.org> <t9klcuql1tym.19vzjgim4rzxg$.dlg@40tude.net> <tg77ib$1273$1@gioia.aioe.org> <tg794n$1pb8$1@gioia.aioe.org> <x6anbwufslo.3p26sr0vs9v8.dlg@40tude.net>
Injection-Info: gioia.aioe.org; logging-data="31279"; posting-host="XakcSTEO51npqVb7OVl71w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-MSMail-Priority: Normal
X-RFC2646: Format=Flowed; Original
X-Notice: Filtered by postfilter v. 0.9.2
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-Priority: 3
 by: R.Wieser - Mon, 19 Sep 2022 09:52 UTC

JJ,

> GetWindowLong returns a kernel-space pointer (e.g. 0xFFFF0501)

Hmmm.. In my case (XPsp3) GetWindowLong returned Zero, and getClassLong
returned a kernel-space pointer. I must say that I didn't try to check for
an error though (didn't realize that the standard GWL_* GCL_* indices could
throw them).

> This conclusion is based on the fact that, an application run using
> the SYSTEM account can terminate CSRSS.EXE and BSOD-ed the system.
> So, if it can't subclass the console window, it should mean that,
> the system has prevented it unconditionally - regardless of user
> credentials and privileges.

My focus is userland, so I again didn't even think of trying it under
different accounts. But thank you for the testing (and posting it :-) ).

> Because IMO, it's unbelievable to think that a console window
> message handler is more crucial than CSRSS.EXE.

Hmmmm... I'm allowed to tinker around with most all GUI windows, but am not
allowed to do the same with a console one. I'm not so sure I understand
that distinction.

But, as doing anything with a console window is either not allowed or is
iffy I'm already looking in another direction (creating a GUI window and
sending the graphical data to it).

By the way, I also tried to use VESA, but that locked up the 'puter as well.
:-\ I knew (was warned about it that) the NVIDIA GT 730 video card is a
simple one, but *that* simple ?...

Regards,
Rudy Wieser

Re: Console Window - subclassing (capturing WM_PAINT) : How ?

<u3fpg2sx1gb9.xkwkdbbci03s$.dlg@40tude.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1111&group=comp.os.ms-windows.programmer.win32#1111

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: jj4public@outlook.com (JJ)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console Window - subclassing (capturing WM_PAINT) : How ?
Date: Tue, 20 Sep 2022 15:21:48 +0700
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <u3fpg2sx1gb9.xkwkdbbci03s$.dlg@40tude.net>
References: <tg4c7r$148$1@gioia.aioe.org> <t9klcuql1tym.19vzjgim4rzxg$.dlg@40tude.net> <tg77ib$1273$1@gioia.aioe.org> <tg794n$1pb8$1@gioia.aioe.org> <x6anbwufslo.3p26sr0vs9v8.dlg@40tude.net> <tg9e58$uhf$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="a5f2fba48956f57827348a5ceb79f954";
logging-data="1513159"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/wwczV3mzvxaQ675Z4uL7dZFJRWZk76LM="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:kycfTOIrnw3wEtmUVlLfvpwCv4M=
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
 by: JJ - Tue, 20 Sep 2022 08:21 UTC

On Mon, 19 Sep 2022 11:52:36 +0200, R.Wieser wrote:
>
> My focus is userland, so I again didn't even think of trying it under
> different accounts. But thank you for the testing (and posting it :-) ).

That was a userland test, but using the SYSTEM account rather than an
account member of the Administrator group.

> Hmmmm... I'm allowed to tinker around with most all GUI windows, but am not
> allowed to do the same with a console one. I'm not so sure I understand
> that distinction.

To my understanding, console window is a protected window. Since Vista, it's
even more protected, by separating the handler in a separate CONHOST.EXE
process which is spawned by CSRSS.EXE for each console window. Perhaps the
contents of the console window is rendered in a special way, which I
suspect, is handled directly from kernel-space. Because that would explain
the blazingly fast rendering of a console window content. If we try to
create our own "console" window class using our own renderer, it will never
be as fast as the real console.

> By the way, I also tried to use VESA, but that locked up the 'puter as well.
>:-\ I knew (was warned about it that) the NVIDIA GT 730 video card is a
> simple one, but *that* simple ?...

What do you mean "use VESA"? AFAIK, Windows doesn't expose any of the
display adapter's VESA API.

Re: Console Window - subclassing (capturing WM_PAINT) : How ?

<tgbus0$12fg$1@gioia.aioe.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1112&group=comp.os.ms-windows.programmer.win32#1112

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!XakcSTEO51npqVb7OVl71w.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console Window - subclassing (capturing WM_PAINT) : How ?
Date: Tue, 20 Sep 2022 10:47:24 +0200
Organization: Aioe.org NNTP Server
Lines: 19
Message-ID: <tgbus0$12fg$1@gioia.aioe.org>
References: <tg4c7r$148$1@gioia.aioe.org> <t9klcuql1tym.19vzjgim4rzxg$.dlg@40tude.net> <tg77ib$1273$1@gioia.aioe.org> <tg794n$1pb8$1@gioia.aioe.org> <x6anbwufslo.3p26sr0vs9v8.dlg@40tude.net> <tg9e58$uhf$1@gioia.aioe.org> <u3fpg2sx1gb9.xkwkdbbci03s$.dlg@40tude.net>
Injection-Info: gioia.aioe.org; logging-data="35312"; posting-host="XakcSTEO51npqVb7OVl71w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Priority: 3
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Notice: Filtered by postfilter v. 0.9.2
 by: R.Wieser - Tue, 20 Sep 2022 08:47 UTC

JJ,

> What do you mean "use VESA"? AFAIK, Windows doesn't expose any of
> the display adapter's VESA API.

My problem started with a DOS program (QBASIC) locking up when I tried to
switch sceen modus ("screen 13", 640x640, 256 color graphics).

I stayed in DOS and checked INT 0x10, AH=0x00 to see if it would make a
difference. It didn't. Than I also tried VESA (INT 0x10, AH=0x4E) with a
modus returned by the card itself(?) (INT 0x10 AX=4E00). No workie either.

And before you ask: I'm using the BOP method to transfer data from the DOS
environment to the Windows one : http://sta.c64.org/blog/dosvddaccess.html

Regards,
Rudy Wieser

Re: Console Window - subclassing (capturing WM_PAINT) : graphics are possible.

<tgue7v$1kkg$1@gioia.aioe.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1113&group=comp.os.ms-windows.programmer.win32#1113

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!XakcSTEO51npqVb7OVl71w.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console Window - subclassing (capturing WM_PAINT) : graphics are possible.
Date: Tue, 27 Sep 2022 11:02:46 +0200
Organization: Aioe.org NNTP Server
Lines: 25
Message-ID: <tgue7v$1kkg$1@gioia.aioe.org>
References: <tg4c7r$148$1@gioia.aioe.org>
Injection-Info: gioia.aioe.org; logging-data="53904"; posting-host="XakcSTEO51npqVb7OVl71w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-Notice: Filtered by postfilter v. 0.9.2
X-MSMail-Priority: Normal
X-Priority: 3
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
 by: R.Wieser - Tue, 27 Sep 2022 09:02 UTC

"R.Wieser" <address@not.available> wrote in message
news:tg4c7r$148$1@gioia.aioe.org...
> Hello all,
>
> I'm trying to draw some simple graphics (dots, lines) into a windowed
> console.
....
> Anyone knows how to do it and wants to share ?

I found some almost decade-old code that does it here :

http://blog.airesoft.co.uk/2012/10/things-ms-can-do-that-they-dont-tell-you-about-console-graphics/

Although there are a number of restrictions, it shows that you can indeed
use the console window for graphics output. :-)

Alas, as it doesn't draw the graphics over the already existing text (and
only works in a windowed console) its not really usefull toward my own goal.
:-\

Regards,
Rudy Wieser

Re: Console Window - subclassing (capturing WM_PAINT) : graphics are possible.

<5zu7hcolcgxy.j5ujyyoqlqbn$.dlg@40tude.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1114&group=comp.os.ms-windows.programmer.win32#1114

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: jj4public@outlook.com (JJ)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console Window - subclassing (capturing WM_PAINT) : graphics are possible.
Date: Wed, 28 Sep 2022 18:51:18 +0700
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <5zu7hcolcgxy.j5ujyyoqlqbn$.dlg@40tude.net>
References: <tg4c7r$148$1@gioia.aioe.org> <tgue7v$1kkg$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="e0e6d4bb678e9e46bd4a9d87306e5ced";
logging-data="388304"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19lYj1MwjPKXIG6cQnkGb1PB8WbmgXczTI="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:WlM+ffBvq69ZC77B70fSqEz0YwQ=
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
 by: JJ - Wed, 28 Sep 2022 11:51 UTC

On Tue, 27 Sep 2022 11:02:46 +0200, R.Wieser wrote:
>
> I found some almost decade-old code that does it here :
>
> http://blog.airesoft.co.uk/2012/10/things-ms-can-do-that-they-dont-tell-you-about-console-graphics/
>
> Although there are a number of restrictions, it shows that you can indeed
> use the console window for graphics output. :-)

That's interresting. I forgot that, console was designed to be able to
present graphic content from DOS based programs while still being windowed.

> You can only create graphics buffers on 32-bit versions of Windows [4].

Kind of expected that, since 64-bit Windows no longer support 16-bit
programs. But... FUUU!!

> Alas, as it doesn't draw the graphics over the already existing text (and
> only works in a windowed console) its not really usefull toward my own goal.
>:-\

That may be worked around by hooking the drawing function and if necessary,
use an off-screen console graphic buffer, but I suspect that the code which
use the function is in kernel space.

Re: Console Window - subclassing (capturing WM_PAINT) : graphics are possible.

<th1g9p$1bup$1@gioia.aioe.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1115&group=comp.os.ms-windows.programmer.win32#1115

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!XakcSTEO51npqVb7OVl71w.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console Window - subclassing (capturing WM_PAINT) : graphics are possible.
Date: Wed, 28 Sep 2022 14:56:16 +0200
Organization: Aioe.org NNTP Server
Lines: 45
Message-ID: <th1g9p$1bup$1@gioia.aioe.org>
References: <tg4c7r$148$1@gioia.aioe.org> <tgue7v$1kkg$1@gioia.aioe.org> <5zu7hcolcgxy.j5ujyyoqlqbn$.dlg@40tude.net>
Injection-Info: gioia.aioe.org; logging-data="45017"; posting-host="XakcSTEO51npqVb7OVl71w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-Priority: 3
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MSMail-Priority: Normal
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
 by: R.Wieser - Wed, 28 Sep 2022 12:56 UTC

JJ,

>> You can only create graphics buffers on 32-bit versions of Windows [4].
>
> Kind of expected that, since 64-bit Windows no longer support 16-bit
> programs. But... FUUU!!

I'm not so sure it has anything to do with 16-bit programs : In the example
the console buffer itself is 32 bits, as is the program feeding it.

Having said that, I've got no idea what actually prohibits it.

>> Alas, as it doesn't draw the graphics over the already existing text
>> (and only works in a windowed console) its not really usefull toward
>> my own goal. :-\
>
> That may be worked around by hooking the drawing function

:-) That was what I was looking for, but have not been able to find.

I /could/ do it the other way around I suppose : grab a copy of the target
window(s graphics), draw my own stuff over it and present that as the new
data. But again, no synchronisation between the two.

And I got caught out by the example : I implemented that code and got zero
result from it. ...Until I realized that I was running the code in a
fullscreen 80x25 console, and not from a windowed one. After I switched
over the image did indeed appear. :-)

By the way : I got something to work with that BOP method, but ultimatily
decided against it - the intermediate DLL needs to be registered *and
unregistered* in the DOS program. Fail to unregister it and the next usage
doesn't give the desired result. :-|

As switching to a DOS graphics mode isn't possible (on that one machine) and
as such I'm forced to use a windowed console anyway I thought of just using
a standard Windows dialog and communicate with it (from within the DOS
program) thru a 'named pipe' (which I can just "print" to). Seems to work
alright.

Regards,
Rudy Wieser

Re: Console Window - subclassing (capturing WM_PAINT) : graphics are possible.

<10b5mi61iaabb$.f0gvub7jpay8$.dlg@40tude.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1116&group=comp.os.ms-windows.programmer.win32#1116

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: jj4public@outlook.com (JJ)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console Window - subclassing (capturing WM_PAINT) : graphics are possible.
Date: Thu, 29 Sep 2022 23:58:43 +0700
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <10b5mi61iaabb$.f0gvub7jpay8$.dlg@40tude.net>
References: <tg4c7r$148$1@gioia.aioe.org> <tgue7v$1kkg$1@gioia.aioe.org> <5zu7hcolcgxy.j5ujyyoqlqbn$.dlg@40tude.net> <th1g9p$1bup$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="11eaeb4df6548a3df3f0921e00a4daf0";
logging-data="752808"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+eK3irimt9VOklD3qWV2BO6nRTceNmEaQ="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:fZNOKlgpyGkAIEZab9ivGg+2ZDs=
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
 by: JJ - Thu, 29 Sep 2022 16:58 UTC

On Wed, 28 Sep 2022 14:56:16 +0200, R.Wieser wrote:
>
> I'm not so sure it has anything to do with 16-bit programs : In the example
> the console buffer itself is 32 bits, as is the program feeding it.
>
> Having said that, I've got no idea what actually prohibits it.

I wasn't referring to the graphic console buffer's bitmap bit depth.

Graphic content in windowed console only exist for supporting real mode or
V86 mode programs which may use graphic video mode. 64-bit Windows no longer
has 16-bit subsystem. There's no longer need to have graphic cosole buffer
in 64-bit Windows, since there's nothing which runs in real or V86 mode.

Re: Console Window - subclassing (capturing WM_PAINT) : graphics are possible.

<th4p8e$16dj$1@gioia.aioe.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1117&group=comp.os.ms-windows.programmer.win32#1117

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!aioe.org!XakcSTEO51npqVb7OVl71w.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console Window - subclassing (capturing WM_PAINT) : graphics are possible.
Date: Thu, 29 Sep 2022 20:47:29 +0200
Organization: Aioe.org NNTP Server
Lines: 28
Message-ID: <th4p8e$16dj$1@gioia.aioe.org>
References: <tg4c7r$148$1@gioia.aioe.org> <tgue7v$1kkg$1@gioia.aioe.org> <5zu7hcolcgxy.j5ujyyoqlqbn$.dlg@40tude.net> <th1g9p$1bup$1@gioia.aioe.org> <10b5mi61iaabb$.f0gvub7jpay8$.dlg@40tude.net>
Injection-Info: gioia.aioe.org; logging-data="39347"; posting-host="XakcSTEO51npqVb7OVl71w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
 by: R.Wieser - Thu, 29 Sep 2022 18:47 UTC

JJ,

>> Having said that, I've got no idea what actually prohibits it.
>
> I wasn't referring to the graphic console buffer's bitmap bit depth.

I didn't think you where. I was just putting forward that both the screen
buffer as well as the code are 32 bit, and should be no problem for a 64-bit
environment.

> There's no longer need to have graphic cosole buffer in 64-bit Windows,
> since there's nothing which runs in real or V86 mode.

As it seems that the calls / code runs fine without either real or V86 mode*
it doesn't quite look as if thats the reason.

* I just checked, running that code doesn't activate/use NTVDM.

It might just be the reason why we are not allowed to tap into the message
loop of a console window : security. Being able to control (override) what
is shown in a console window might be considered a problem.

Than again, who knows. :-)

Regards,
Rudy Wieser

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor