C#
C# WinAPI - FindWindowEx
hwanjung
2022. 3. 24. 12:13
using System.Runtime.InteropServices;
[DllImport("user32.dll")]
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll")]
private static extern IntPtr FindWindowEx(IntPtr hWnd1, IntPtr hWnd2, string lpsz1, string lpsz2);
private IntPtr FindHandleEx(String winName)
{
IntPtr handle1 = FindWindow(null, winName);
IntPtr handle2 = FindWindowEx(handle1, IntPtr.Zero, null, "자식창이름");
return handle2;
}