When there are multiple forms of one window app, I want to get the parent WindowMainHandle. (Main Form)
The problem is that when the child form is selected, I get the child WindowMainHandle.
how should i solve it?
Process[] viewProcesses = Process.GetProcessesByName(Application.ProductName); IntPtr hWndOfPrevInstance = viewProcesses[0].MainWindowHandle;