I want to write a GUI-application for NT, that uses the abilities of a
console for its main window.
So I tried CreateWindow("ConsoleWindowClass",...), but Windows returns
"Cannot find window class".
Then I created a console by AllocConsole() and took its window handle to
set a menu to the console. That works fine, but to process the
WM_COMMAND-messages I need to subclass the window:
SetWindowLong(hwndConsole,GWL_WNDPROC,(LONG)SubclassProc);
Windows returns "Invalid index". Has anybody an idea?
SetWindowLong() specifically disallows attempts to hook the console window
procedure.
As far as I can tell this is sheer peevishness on Microsoft's part. I can
hook the console window just fine by directly poking the address of my window
procedure into the WND structure in USER.EXE.
They are the only way to, for example, let a hidden console process run as a
service under Windows 95 and survive a logoff.
To do this I wrote 400 lines of C and assembly code in a thunked 32/16 DLL
that used some nasty undocumented APIs known only to insiders. As far as I
know there is no other way.
Alan Klietz al...@pobox.NOSPAM.com
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum