By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,314 Members | 1,790 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,314 IT Pros & Developers. It's quick & easy.

Intercepting system calls in .NET

P: n/a
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?
Oct 14 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
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]
- mv*@spam.guard.caspershouse.com

"Peter Olcott" <ol****@att.net> wrote in message
news:2ZN3f.5212$bt2.2196@okepread05...
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?

Oct 14 '05 #2

P: n/a

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:ur**************@tk2msftngp13.phx.gbl...
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]
- mv*@spam.guard.caspershouse.com

"Peter Olcott" <ol****@att.net> wrote in message news:2ZN3f.5212$bt2.2196@okepread05...
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?
Oct 14 '05 #3

P: n/a
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]
- mv*@spam.guard.caspershouse.com

"Peter Olcott" <ol****@att.net> wrote in message
news:a4Q3f.5217$bt2.167@okepread05...

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:ur**************@tk2msftngp13.phx.gbl...
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]
- mv*@spam.guard.caspershouse.com

"Peter Olcott" <ol****@att.net> wrote in message
news:2ZN3f.5212$bt2.2196@okepread05...
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?

Oct 14 '05 #4

P: n/a
I want to be able to consistently be able to have an application
"see" exactly what is on the screen.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:Ok**************@TK2MSFTNGP14.phx.gbl...
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]
- mv*@spam.guard.caspershouse.com

"Peter Olcott" <ol****@att.net> wrote in message news:a4Q3f.5217$bt2.167@okepread05...

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:ur**************@tk2msftngp13.phx.gbl...
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]
- mv*@spam.guard.caspershouse.com

"Peter Olcott" <ol****@att.net> wrote in message news:2ZN3f.5212$bt2.2196@okepread05...
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?


Oct 14 '05 #5

P: n/a
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]
- mv*@spam.guard.caspershouse.com

"Peter Olcott" <ol****@att.net> wrote in message
news:iLQ3f.5222$bt2.4976@okepread05...
I want to be able to consistently be able to have an application
"see" exactly what is on the screen.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:Ok**************@TK2MSFTNGP14.phx.gbl...
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]
- mv*@spam.guard.caspershouse.com

"Peter Olcott" <ol****@att.net> wrote in message
news:a4Q3f.5217$bt2.167@okepread05...

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:ur**************@tk2msftngp13.phx.gbl...
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]
- mv*@spam.guard.caspershouse.com

"Peter Olcott" <ol****@att.net> wrote in message
news:2ZN3f.5212$bt2.2196@okepread05...
> 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?



Oct 14 '05 #6

P: n/a
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 [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:uG*************@TK2MSFTNGP15.phx.gbl...
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]
- mv*@spam.guard.caspershouse.com

"Peter Olcott" <ol****@att.net> wrote in message news:iLQ3f.5222$bt2.4976@okepread05...
I want to be able to consistently be able to have an application
"see" exactly what is on the screen.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:Ok**************@TK2MSFTNGP14.phx.gbl...
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]
- mv*@spam.guard.caspershouse.com

"Peter Olcott" <ol****@att.net> wrote in message news:a4Q3f.5217$bt2.167@okepread05...

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message
news:ur**************@tk2msftngp13.phx.gbl...
> 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]
> - mv*@spam.guard.caspershouse.com
>
> "Peter Olcott" <ol****@att.net> wrote in message news:2ZN3f.5212$bt2.2196@okepread05...
>> 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?



Oct 14 '05 #7

P: n/a
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]
- mv*@spam.guard.caspershouse.com
"Peter Olcott" <ol****@att.net> wrote in message
news:CYQ3f.5224$bt2.4102@okepread05...
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 [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:uG*************@TK2MSFTNGP15.phx.gbl...
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]
- mv*@spam.guard.caspershouse.com

"Peter Olcott" <ol****@att.net> wrote in message
news:iLQ3f.5222$bt2.4976@okepread05...
I want to be able to consistently be able to have an application
"see" exactly what is on the screen.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:Ok**************@TK2MSFTNGP14.phx.gbl...
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]
- mv*@spam.guard.caspershouse.com

"Peter Olcott" <ol****@att.net> wrote in message
news:a4Q3f.5217$bt2.167@okepread05...
>
> "Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com>
> wrote in message news:ur**************@tk2msftngp13.phx.gbl...
>> 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]
>> - mv*@spam.guard.caspershouse.com
>>
>> "Peter Olcott" <ol****@att.net> wrote in message
>> news:2ZN3f.5212$bt2.2196@okepread05...
>>> 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?
>



Oct 14 '05 #8

P: n/a
What about all the text and font info contained within
any other program's window?

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:eS**************@TK2MSFTNGP12.phx.gbl...
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]
- mv*@spam.guard.caspershouse.com
"Peter Olcott" <ol****@att.net> wrote in message news:CYQ3f.5224$bt2.4102@okepread05...
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 [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:uG*************@TK2MSFTNGP15.phx.gbl...
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]
- mv*@spam.guard.caspershouse.com

"Peter Olcott" <ol****@att.net> wrote in message news:iLQ3f.5222$bt2.4976@okepread05...
I want to be able to consistently be able to have an application
"see" exactly what is on the screen.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message
news:Ok**************@TK2MSFTNGP14.phx.gbl...
> 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]
> - mv*@spam.guard.caspershouse.com
>
> "Peter Olcott" <ol****@att.net> wrote in message news:a4Q3f.5217$bt2.167@okepread05...
>>
>> "Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message
>> news:ur**************@tk2msftngp13.phx.gbl...
>>> 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]
>>> - mv*@spam.guard.caspershouse.com
>>>
>>> "Peter Olcott" <ol****@att.net> wrote in message news:2ZN3f.5212$bt2.2196@okepread05...
>>>> 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?
>>
>
>



Oct 14 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.