Is there a way to get the window handle (IntPtr) for a window after its launched from a C# app with Process.Start()?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Use
It probably is 0 when launching the app, so you might want to loop and sleep until it is filled up.
If it's the main window you're after,
Process.MainWindowHandle
will give you what you need.This is not a recent topic but the answers are incomplete.
I agree with the Process.MainWindowHandle solution and to wait for the value but not with Sleep.
Process.WaitForInputIdle
You could also call Refresh() on the process to be sure the info in accurate