예제 #1
0
        internal static bool IsHwndOnProcThread(System.IntPtr hWnd, int processId, int threadId)
        {
            int num;
            int windowThreadProcessId = Win32NativeMethods.GetWindowThreadProcessId(hWnd, out num);

            processId = ((int)processId).Equals(0) ? num : processId;
            threadId  = ((int)threadId).Equals(0) ? windowThreadProcessId : threadId;
            return((bool)((processId == num) && ((bool)(threadId == windowThreadProcessId))));
        }
        internal static bool IsWow64ProcessMode(System.IntPtr hwnd)
        {
            int  lpdwProcessId = 0;
            bool lpSystemInfo  = false;

            Win32NativeMethods.GetWindowThreadProcessId(hwnd, out lpdwProcessId);
            Win32NativeMethods.IsWow64Process(Process.GetProcessById(lpdwProcessId).Handle, out lpSystemInfo);
            return(lpSystemInfo);
        }