我正在制作一个自动化程序,但是在某个部分发出警报消息后,该程序不再继续。按下警报消息后,程序将恢复。有没有办法识别警报消息窗口?
我试图通过使用 spy ++ 获取进程 ID 来获取警报消息的句柄,但它失败了我想要的句柄是 #32770 的第四个孩子
using System;
using System.Runtime.InteropServices;
namespace _1_1Con
{
class Class1
{
[DllImport("user32.dll")]
public static extern IntPtr GetWindow(IntPtr hWnd, int uCmd);
[DllImport("user32.dll")]
public static extern int FindWindow(string lpClassName,string lpWindowName);
[DllImport("user32.dll")]
public static extern int FindWindowEx(int hWnd1,int hWnd2,string lpsz1,string lpsz2);
[DllImport("user32.dll")]
public static extern int SendMessage(int hwnd,int wMsg,int wParam,int lParam);
const int GW_CHILD = 5;
[STAThread]
static void Main(string[] args)
{
int hw1=FindWindow(null,"#32770");
int hwnd_four=GetWindow(hw1,GW_CHILD);
}
}
}