Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / April 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andrew - 26 Apr 2007 22:42 GMT
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.
Chris Mullins [MVP] - 26 Apr 2007 23:26 GMT
> 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?

Signature

Chris Mullins, MCSD.NET, MCPD:Enterprise, Microsoft C# MVP
http://www.coversant.com/blogs/cmullins

Andrew - 27 Apr 2007 17:46 GMT
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.

> > 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?
[quoted text clipped - 3 lines]
>
> What are you trying to accomplish?
Michael Nemtsev - 27 Apr 2007 14:33 GMT
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
Andrew - 27 Apr 2007 17:46 GMT
I am reading them, thank you, Michael...

> Hello Andrew,
>
[quoted text clipped - 13 lines]
> "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) Michelangelo

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.