Пример #1
0
        public DialogFinderProgram()
        { 
            WndSearcher ws = new WndSearcher();

            BackgroundWorker bw = new BackgroundWorker();
            bw.DoWork += new DoWorkEventHandler(bw_DoWork);

            bw.RunWorkerAsync();
        }
Пример #2
0
        public DialogFinderProgram()
        {
            WndSearcher ws = new WndSearcher();

            BackgroundWorker bw = new BackgroundWorker();

            bw.DoWork += new DoWorkEventHandler(bw_DoWork);

            bw.RunWorkerAsync();
        }
Пример #3
0
        //const int WM_KEYDOWN = 0x100;
        //const int WM_KEYUP = 0x101;
        //const int L_KEY = 0x4C;
        //const int WM_NEXTDLGCTL = 0x0028;

        public static void bw_DoWork(object sender, DoWorkEventArgs e)
        {
            while (1 == 1)
            {
                Thread.Sleep(1000);
                IntPtr hWnd = WndSearcher.SearchForWindow("bosa_sdm_Microsoft", "Passord");
                if (hWnd != IntPtr.Zero)
                {
                    SetForegroundWindow(hWnd);
                    Thread.Sleep(100);
                    SendKeys.SendWait("{ENTER}");
                    //Thread.Sleep(100);
                }
            }
        }