如何获取任务栏内程序图标坐标,鼠标单击?
比如我要找到“新建文件夹”图标在任务栏得坐标,移动鼠标到这个图标上,单击?谢谢各位帮忙....
用下面这段代码得到的是负值。。。
Private Sub Command1_Click()
Dim h As Long, r As RECT
h = FindWindow(vbNullString, Text1.Text) '这里写上你的窗口标题,必须一字不差
GetWindowRect h, r
MsgBox "左上角坐标(" & r.Left & "," & r.Top & ")" & vbCrLf & "右下角坐标(" & r.Right & "," & r.Bottom & ")" & vbCrLf & "窗口高" & r.Bottom - r.Top & "窗口宽" & r.Right - r.Left
End Sub