|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
What can we do in C#.net with a given window handle?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. "Andrew" <And***@discussions.microsoft.com> wrote Anything you could do in Win32 you can do in C#. It may require some Win32 > 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? calls, but really there are no limits. What are you trying to accomplish? -- Chris Mullins, MCSD.NET, MCPD:Enterprise, Microsoft C# MVP http://www.coversant.com/blogs/cmullins 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. Show quote "Chris Mullins [MVP]" wrote: > "Andrew" <And***@discussions.microsoft.com> wrote > > 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? > > -- > Chris Mullins, MCSD.NET, MCPD:Enterprise, Microsoft C# MVP > http://www.coversant.com/blogs/cmullins > > > 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) Michelangelo I am reading them, thank you, Michael...
Show quote "Michael Nemtsev" wrote: > 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) Michelangelo > > > |
|||||||||||||||||||||||