R.Wieser
2022-09-17 11:49:11 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
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