我试图在窗口上找到特定 ProgressBar (msctls_progress32) 的值,
我找到了窗口:
[DllImport("User32.dll")]
public static extern IntPtr FindWindow(string strClassName, string strWindowName);
但我无法获得 ProgressBar 的指针:
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle);
然后,一旦我有了指针,我想用以下方法获取值:
public const int PBM_GETPOS = 0x0408;
[DllImport("User32.dll")]
public static extern Int32 SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
问题是窗口上有多个进度条,我想要指针的进度条在多个 #32770(对话框)内