What can we do in C#.net with a given window handle?

G

Guest

Hello, friends,

What can we do in C#.net with a given window handle? For example, can we
activate or close this window? How? Any reference papers?

Thanks a lot.
 
C

Chris Mullins [MVP]

Andrew said:
What can we do in C#.net with a given window handle? For example, can we
activate or close this window? How? Any reference papers?

Anything you could do in Win32 you can do in C#. It may require some Win32
calls, but really there are no limits.

What are you trying to accomplish?
 
M

Michael Nemtsev

Hello Andrew,

A> For example, can we activate or close this window? How? Any reference
papers?

You need to get the handle, which is represented in IntPrt structure, and
use it as the standard HANDLE in all Win32 api methods called via p/invoke.

Start from this sample http://pinvoke.net/default.aspx/coredll/SendMessage.html



---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangel
 
G

Guest

Thanks, Chris,

Well, some of them includes:

If I have an array of IntPtr, can we tell whick IntPtr is for a Word app,
which IntPtr is for Excel app, which IntPtr is for user app, etc.

Moreover, if we can tell, then, can we use IntPtr to interact with the app?
For example, find out document file name opened in a Word app, or instruct a
Word app to Save or Open a file utilizing this Word app's IntPtr?

If yes, how? Any reference papers? Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top