The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: dedndave on March 22, 2011, 03:32:07 AM

Title: Fun With Console Window
Post by: dedndave on March 22, 2011, 03:32:07 AM
just playing around, here
i tried this to see if it would work...

(http://img816.imageshack.us/img816/5093/conmenu.png)

...and it does   :8)
however, i have to figure out a way to intercept the messages that go to the console window
with a little effort, you could add features and, perhaps, fix a couple console bugs

i guess i could use PeekMessage or something
any ideas ?

oh - i know.....
SetWindowLong and redirect the messages by setting WndProc   :bg
i can get the original WndProc address first, maybe ?
and use that as kind of a DefWindowProc
Title: Re: Fun With Console Window
Post by: dedndave on March 22, 2011, 03:43:48 AM
got it !!!!

GetClassLong / SetClassLong

we can have all kinds of fun with this   :8)

one use i can see right off....

Copy to Clipboard with code tags
but - it's not limited to just adding a menu
there are all kinds of things we can do
Title: Re: Fun With Console Window
Post by: hutch-- on March 22, 2011, 07:07:54 AM
Dave,

Direct clipboard cut copy and paste into the console would be a big plus, depends how much work you want to do.
Title: Re: Fun With Console Window
Post by: dedndave on March 22, 2011, 04:48:32 PM
still have an issue to work out
how to run a program inside the console - like the old TSR's
well - something along that line
it may require something like running cmd.exe in a shell - haven't figured out the details
i will ponder it for a while   :P
Title: Re: Fun With Console Window
Post by: donkey on March 22, 2011, 05:00:02 PM
Hi Dave,

Reading through the thread I still can't figure out what you're trying to do. But if its to communicate with an app running in the console, couldn't you just use pipes ?
Title: Re: Fun With Console Window
Post by: dedndave on March 22, 2011, 05:22:27 PM
hi Edgar
well - i wasn't really trying to accomplish anything to begin with - lol
but - the idea entered my mind that things can be done with the console that i hadn't thought of previously
the copy/paste bugs of the console could be fixed - and even enhanced
it is simply a matter of getting the window handle and "having your way" with it
Title: Re: Fun With Console Window
Post by: redskull on March 22, 2011, 06:10:25 PM
Quote from: dedndave on March 22, 2011, 05:22:27 PM
it is simply a matter of getting the window handle and "having your way" with it

I tried having my way with console windows in the past, but found it not quite that simple.  Some things just don't work for console windows, no matter what sort of shenigans you try.  The only one I can think of off-hand is subclassing, but i remember many things just failing for no apparent reason.  But I'm very interested to see this sort of fun, so please keep posting your success stories.

-r
Title: Re: Fun With Console Window
Post by: dedndave on March 22, 2011, 06:34:21 PM
that's really what it is, too, Red - just for fun   :P
but - something useful may come of it