Spy++ on console application

March 03rd, 2004 - 12:11 am ET by mlc | Report spam
How come I can not watch messages for a console application?
email Follow the discussionReplies 5 repliesReplies Make a reply

Similar topics

Replies

#1 Gary Chanson
March 03rd, 2004 - 12:21 am ET | Report spam
"mlc" wrote in message
news:kOd1c.19160$
How come I can not watch messages for a console application?



Because Windows message hooks don't work on a console window in Win2K/XP
(they do work on DOS windows in Win9x though).


-GJC [MS Windows SDK MVP]
-Software Consultant (Embedded systems and Real Time Controls)
- http://www.mvps.org/ArcaneIncantati...ulting.htm

Replies Reply to this message
#2 Eric Lawrence [MSFT]
March 03rd, 2004 - 12:32 am ET | Report spam
What exactly are you trying to spy on?

Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.

"mlc" wrote in message
news:kOd1c.19160$
How come I can not watch messages for a console application?





Replies Reply to this message
#3 mlc
March 03rd, 2004 - 11:04 am ET | Report spam
I am trying to figure out who is handling the system menu for a console app.
is it the explorer, the consolewidowclass in some secret way or what. The
question is who handles the console app window frame and can this be
communicated to the console app itself. There are setconsolemode() 'hooks'
that will allow you get keyboard events, special keys, mouse events, and
yes, menu events (that documented to say don't use them).

"Eric Lawrence [MSFT]" wrote in message
news:
What exactly are you trying to spy on?

Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no


rights.

"mlc" wrote in message
news:kOd1c.19160$
> How come I can not watch messages for a console application?
>
>
>




Replies Reply to this message
#4 Gary Chanson
March 03rd, 2004 - 01:11 pm ET | Report spam
"mlc" wrote in message
news:Rln1c.17230$
I am trying to figure out who is handling the system menu for a console


app.
is it the explorer, the consolewidowclass in some secret way or what. The
question is who handles the console app window frame and can this be
communicated to the console app itself. There are setconsolemode() 'hooks'
that will allow you get keyboard events, special keys, mouse events, and
yes, menu events (that documented to say don't use them).



These are handles by the console subsystem and your access is limited to
what is documented (I think for security reasons).


-GJC [MS Windows SDK MVP]
-Software Consultant (Embedded systems and Real Time Controls)
- http://www.mvps.org/ArcaneIncantati...ulting.htm

Replies Reply to this message
#5 Tim Robinson
March 03rd, 2004 - 03:13 pm ET | Report spam
mlc wrote:
I am trying to figure out who is handling the system menu for a
console app. is it the explorer, the consolewidowclass in some secret
way or what. The question is who handles the console app window frame
and can this be communicated to the console app itself. There are
setconsolemode() 'hooks' that will allow you get keyboard events,
special keys, mouse events, and yes, menu events (that documented to
say don't use them).



Console windows are handled entirely by CSRSS, which is a system process.
Installing a hook into a process means injecting your DLL into it. Since
CSRSS is so important (it's vital for running of the system, and code within
runs as LocalSystem, which is the local super-admin user), you're not
allowed to inject code into it. So you can't hook any of its windows.

Tim Robinson (MVP, Windows SDK)
http://mobius.sourceforge.net/
email Follow the discussion Replies Reply to this message
Help Create a new topicReplies Make a reply
Search Make your own search