下面这些黑体部分代码表达的是什么意思,返回窗口类名或窗口句柄和返回窗口尺寸有什么作用?IntPtr ptrTaskbar = FindWindow("Shell_TrayWnd", null);
if (ptrTaskbar == IntPtr.Zero)
{
MessageBox.Show("No taskbar found.");
return;
} IntPtr ptrStartBtn = FindWindowEx(new HandleRef(this, ptrTaskbar), new HandleRef(this, IntPtr.Zero), "Button", null);
if (ptrStartBtn == IntPtr.Zero) {
MessageBox.Show("No start button found.");
return;
}
if (ptrTaskbar == IntPtr.Zero)
{
MessageBox.Show("No taskbar found.");
return;
} IntPtr ptrStartBtn = FindWindowEx(new HandleRef(this, ptrTaskbar), new HandleRef(this, IntPtr.Zero), "Button", null);
if (ptrStartBtn == IntPtr.Zero) {
MessageBox.Show("No start button found.");
return;
}
得到窗体,并得到Button按钮