Intercepting system calls in .NET

  • Thread starter Thread starter Peter Olcott
  • Start date Start date
P

Peter Olcott

Is there any way to intercept system calls to windows such as TextOut and DrawText?
what kinds of system calls can be intercepted, and what is the mechanism to accomplish this?
 
Peter,

Short of actually replacing user32.dll with a shim that calls the
originals, there isn't a way I can think of to do this. Also, with the new
windows protection scheme (windows knows when you try to replace system dlls
and whatnot), I doubt you could even do that.

And if you could, I certainly wouldn't want (nor could you do it easily)
with .NET, and you definitely couldn't do it with C#.

Hope this helps.
 
Nicholas Paldino said:
Peter,

Short of actually replacing user32.dll with a shim that calls the originals, there isn't a way I can think of to do this.
Also, with the new windows protection scheme (windows knows when you try to replace system dlls and whatnot), I doubt you could
even do that.

And if you could, I certainly wouldn't want (nor could you do it easily) with .NET, and you definitely couldn't do it with C#.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Peter Olcott said:
Is there any way to intercept system calls to windows such as TextOut and DrawText?
what kinds of system calls can be intercepted, and what is the mechanism to accomplish this?
Can you double check this answer for me please?
 
Peter,

I wouldn't have responded if I didn't think that it was correct. You
could easily look for this information on your own, now that I have given
you some specifics, as well as potential concerns.

It probably would be helpful to know what you are trying to do, as well,
so we could provide alternatives, since the solution I gave isn't desirable,
by any means.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Peter Olcott said:
Nicholas Paldino said:
Peter,

Short of actually replacing user32.dll with a shim that calls the
originals, there isn't a way I can think of to do this. Also, with the
new windows protection scheme (windows knows when you try to replace
system dlls and whatnot), I doubt you could even do that.

And if you could, I certainly wouldn't want (nor could you do it
easily) with .NET, and you definitely couldn't do it with C#.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Peter Olcott said:
Is there any way to intercept system calls to windows such as TextOut
and DrawText?
what kinds of system calls can be intercepted, and what is the mechanism
to accomplish this?
Can you double check this answer for me please?
 
I want to be able to consistently be able to have an application
"see" exactly what is on the screen.

Nicholas Paldino said:
Peter,

I wouldn't have responded if I didn't think that it was correct. You could easily look for this information on your own, now
that I have given you some specifics, as well as potential concerns.

It probably would be helpful to know what you are trying to do, as well, so we could provide alternatives, since the solution I
gave isn't desirable, by any means.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Peter Olcott said:
Nicholas Paldino said:
Peter,

Short of actually replacing user32.dll with a shim that calls the originals, there isn't a way I can think of to do this.
Also, with the new windows protection scheme (windows knows when you try to replace system dlls and whatnot), I doubt you could
even do that.

And if you could, I certainly wouldn't want (nor could you do it easily) with .NET, and you definitely couldn't do it with
C#.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Is there any way to intercept system calls to windows such as TextOut and DrawText?
what kinds of system calls can be intercepted, and what is the mechanism to accomplish this?
Can you double check this answer for me please?
 
To what end? You can easily get the device context for the desktop or
any window in the system and "see" that. Can you be more specific?

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Peter Olcott said:
I want to be able to consistently be able to have an application
"see" exactly what is on the screen.

Nicholas Paldino said:
Peter,

I wouldn't have responded if I didn't think that it was correct. You
could easily look for this information on your own, now that I have given
you some specifics, as well as potential concerns.

It probably would be helpful to know what you are trying to do, as
well, so we could provide alternatives, since the solution I gave isn't
desirable, by any means.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Peter Olcott said:
in message Peter,

Short of actually replacing user32.dll with a shim that calls the
originals, there isn't a way I can think of to do this. Also, with the
new windows protection scheme (windows knows when you try to replace
system dlls and whatnot), I doubt you could even do that.

And if you could, I certainly wouldn't want (nor could you do it
easily) with .NET, and you definitely couldn't do it with C#.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Is there any way to intercept system calls to windows such as TextOut
and DrawText?
what kinds of system calls can be intercepted, and what is the
mechanism to accomplish this?



Can you double check this answer for me please?
 
Can you grab any text from any these device contexts?
If so, can you get the font information?
Is there any way to recognize a specific icon on the desktop?

Nicholas Paldino said:
To what end? You can easily get the device context for the desktop or any window in the system and "see" that. Can you be
more specific?

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Peter Olcott said:
I want to be able to consistently be able to have an application
"see" exactly what is on the screen.

Nicholas Paldino said:
Peter,

I wouldn't have responded if I didn't think that it was correct. You could easily look for this information on your own, now
that I have given you some specifics, as well as potential concerns.

It probably would be helpful to know what you are trying to do, as well, so we could provide alternatives, since the solution
I gave isn't desirable, by any means.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


Peter,

Short of actually replacing user32.dll with a shim that calls the originals, there isn't a way I can think of to do this.
Also, with the new windows protection scheme (windows knows when you try to replace system dlls and whatnot), I doubt you
could even do that.

And if you could, I certainly wouldn't want (nor could you do it easily) with .NET, and you definitely couldn't do it with
C#.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Is there any way to intercept system calls to windows such as TextOut and DrawText?
what kinds of system calls can be intercepted, and what is the mechanism to accomplish this?



Can you double check this answer for me please?
 
Peter,

It would be easier for you to actually enumerate through the users
desktop directory to see what is displayed on the desktop. If you are
trying to do this, just find the users desktop directory, and enumerate
through the items in the directory, and it should give you a good idea of
what is there.

As for the font information, for what is displayed on the desktop, that
is the system font, and you can get that easily.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


Peter Olcott said:
Can you grab any text from any these device contexts?
If so, can you get the font information?
Is there any way to recognize a specific icon on the desktop?

Nicholas Paldino said:
To what end? You can easily get the device context for the desktop or
any window in the system and "see" that. Can you be more specific?

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Peter Olcott said:
I want to be able to consistently be able to have an application
"see" exactly what is on the screen.

in message Peter,

I wouldn't have responded if I didn't think that it was correct.
You could easily look for this information on your own, now that I have
given you some specifics, as well as potential concerns.

It probably would be helpful to know what you are trying to do, as
well, so we could provide alternatives, since the solution I gave isn't
desirable, by any means.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


"Nicholas Paldino [.NET/C# MVP]" <[email protected]>
wrote in message Peter,

Short of actually replacing user32.dll with a shim that calls the
originals, there isn't a way I can think of to do this. Also, with
the new windows protection scheme (windows knows when you try to
replace system dlls and whatnot), I doubt you could even do that.

And if you could, I certainly wouldn't want (nor could you do it
easily) with .NET, and you definitely couldn't do it with C#.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Is there any way to intercept system calls to windows such as
TextOut and DrawText?
what kinds of system calls can be intercepted, and what is the
mechanism to accomplish this?



Can you double check this answer for me please?
 
What about all the text and font info contained within
any other program's window?

Nicholas Paldino said:
Peter,

It would be easier for you to actually enumerate through the users desktop directory to see what is displayed on the desktop.
If you are trying to do this, just find the users desktop directory, and enumerate through the items in the directory, and it
should give you a good idea of what is there.

As for the font information, for what is displayed on the desktop, that is the system font, and you can get that easily.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


Peter Olcott said:
Can you grab any text from any these device contexts?
If so, can you get the font information?
Is there any way to recognize a specific icon on the desktop?

Nicholas Paldino said:
To what end? You can easily get the device context for the desktop or any window in the system and "see" that. Can you be
more specific?

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

I want to be able to consistently be able to have an application
"see" exactly what is on the screen.

Peter,

I wouldn't have responded if I didn't think that it was correct. You could easily look for this information on your own,
now that I have given you some specifics, as well as potential concerns.

It probably would be helpful to know what you are trying to do, as well, so we could provide alternatives, since the
solution I gave isn't desirable, by any means.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


Peter,

Short of actually replacing user32.dll with a shim that calls the originals, there isn't a way I can think of to do this.
Also, with the new windows protection scheme (windows knows when you try to replace system dlls and whatnot), I doubt you
could even do that.

And if you could, I certainly wouldn't want (nor could you do it easily) with .NET, and you definitely couldn't do it
with C#.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Is there any way to intercept system calls to windows such as TextOut and DrawText?
what kinds of system calls can be intercepted, and what is the mechanism to accomplish this?



Can you double check this answer for me please?
 
Back
Top