0

I am making an automation program, but after the alert message is issued in a certain section, the program does not proceed anymore. After pressing the alert message, the program will resume. Is there any way to recognize the alert message window?

I tried to get the handle of the alert message by getting the process id using spy ++ but it failed The handle I want is the fourth of # 32770's children

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);


        }
    }
}
jazb
  • 5,498
  • 6
  • 37
  • 44
박현서
  • 13
  • 5
  • It is not clear to me what you want but see if [EnumChildWindows](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enumchildwindows) helps. –  Aug 06 '19 at 03:44
  • thank you. If there are any further blockages, I will post again. – 박현서 Aug 06 '19 at 04:41

0 Answers0