SyntaxFix
Write A Post
Hire A Developer
Questions
Old question but appears to have a lot of traffic, here is a simple solution:
IntPtr GetMainWindowHandle(IntPtr aHandle) { return System.Diagnostics.Process.GetProcessById(aHandle.ToInt32()).MainWindowHandle; }