all groups > dotnet interop > november 2007 >
You're in the

dotnet interop

group:

How do I find the main window handle?


How do I find the main window handle? Mike
11/26/2007 11:57:33 AM
dotnet interop:
In a DLL written in C#, how can you get the handle of the main window
of the app that called you?

Thanks,
Re: How do I find the main window handle? Mike
11/26/2007 12:45:43 PM
That seems to work. Thanks!

On Nov 26, 3:21 pm, "Nicholas Paldino [.NET/C# MVP]"
[quoted text, click to view]
Re: How do I find the main window handle? Nicholas Paldino [.NET/C# MVP]
11/26/2007 3:21:31 PM
Mike,

AFAIK, there is no API that will do this for you.

Rather, the easiest way I can think of is to call the static
GetCurrentProcess method on the Process class and then access the
MainWindowHandle property on the Process instance returned.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

[quoted text, click to view]

AddThis Social Bookmark Button