コード例 #1
0
        /// <summary>
        /// Called by the constructor to start watching popups
        /// on a separate thread.
        /// </summary>
        private void Start()
        {
            while (keepRunning)
            {
                Process process = getProcess(ProcessId);

                if (process != null)
                {
                    foreach (ProcessThread t in process.Threads)
                    {
                        int threadId = t.Id;

                        NativeMethods.EnumThreadProc callbackProc = new NativeMethods.EnumThreadProc(myEnumThreadWindowsProc);
                        NativeMethods.EnumThreadWindows(threadId, callbackProc, IntPtr.Zero);
                    }

                    // Keep DialogWatcher responsive during 1 second sleep period
                    int count = 0;
                    while (keepRunning && count < 5)
                    {
                        Thread.Sleep(200);
                        count++;
                    }
                }
                else
                {
                    keepRunning = false;
                }
            }
        }
コード例 #2
0
        public PopupDialogCollection(Process infoPathProcess)
        {
            popupDialogs = new ArrayList();

            IntPtr hWnd = IntPtr.Zero;

            foreach (ProcessThread t in infoPathProcess.Threads)
            {
                int threadId = t.Id;

                NativeMethods.EnumThreadProc callbackProc = new NativeMethods.EnumThreadProc(EnumChildForTridentDialogFrame);
                NativeMethods.EnumThreadWindows(threadId, callbackProc, hWnd);
            }
        }
コード例 #3
0
        public PopupDialogCollection(Process infoPathProcess)
        {
            popupDialogs = new ArrayList();

            IntPtr hWnd = IntPtr.Zero;

            foreach (ProcessThread t in infoPathProcess.Threads)
            {
            int threadId = t.Id;

            NativeMethods.EnumThreadProc callbackProc = new NativeMethods.EnumThreadProc(EnumChildForTridentDialogFrame);
            NativeMethods.EnumThreadWindows(threadId, callbackProc, hWnd);
            }
        }
コード例 #4
0
        public HtmlDialogCollection(Process ieProcess, bool waitForComplete)
        {
            _waitForComplete = waitForComplete;
            htmlDialogs      = new ArrayList();

            IntPtr hWnd = IntPtr.Zero;

            foreach (ProcessThread t in ieProcess.Threads)
            {
                int threadId = t.Id;

                NativeMethods.EnumThreadProc callbackProc = new NativeMethods.EnumThreadProc(EnumChildForTridentDialogFrame);
                NativeMethods.EnumThreadWindows(threadId, callbackProc, hWnd);
            }
        }
コード例 #5
0
		public HtmlDialogCollection(Process ieProcess, bool waitForComplete)
		{
			_waitForComplete = waitForComplete;
			htmlDialogs = new ArrayList();

			IntPtr hWnd = IntPtr.Zero;

			foreach (ProcessThread t in ieProcess.Threads)
			{
				int threadId = t.Id;

				NativeMethods.EnumThreadProc callbackProc = new NativeMethods.EnumThreadProc(EnumChildForTridentDialogFrame);
				NativeMethods.EnumThreadWindows(threadId, callbackProc, hWnd);
			}
		}
コード例 #6
0
ファイル: DialogWatcher.cs プロジェクト: pusp/o2platform
		/// <summary>
		/// Called by the constructor to start watching popups
		/// on a separate thread.
		/// </summary>
		private void Start()
		{
			while (keepRunning)
			{
				Process process = getProcess(ProcessId);

				if (process != null)
				{
					foreach (ProcessThread t in process.Threads)
					{
                        if (!keepRunning) return;

						int threadId = t.Id;

						NativeMethods.EnumThreadProc callbackProc = new NativeMethods.EnumThreadProc(myEnumThreadWindowsProc);
						NativeMethods.EnumThreadWindows(threadId, callbackProc, IntPtr.Zero);
					}

					// Keep DialogWatcher responsive during 1 second sleep period
					int count = 0;
					while (keepRunning && count < 5)
					{
						Thread.Sleep(200);
						count++;
					}
				}
				else
				{
					keepRunning = false;
				}
			}
		}