public static void SetWindowPos(IntPtr hWnd)
        {
            SetWindowPos(hWnd, -1, 0, 0, 0, 0, 0x4000 | 0x0001 | 0x0002);
        }

        public static Process GetGameProcess(string processName)
        {
            Process pro = null;
            Process[] pros = Process.GetProcessesByName(processName);
            if (pros.Length > 0)
            {
                pro = pros[0];
            }
            IntPtr m_WindowHandle = IntPtr.Zero;
            m_WindowHandle = pro.MainWindowHandle;
            return pro;
        }
    }
}

//例子
API.SendMessage(m_WindowHandle, API.WM_CLOSE, 0, 0);

相关文章:

  • 2021-09-15
  • 2022-12-23
  • 2022-02-07
  • 2021-10-21
  • 2022-12-23
  • 2021-09-23
  • 2022-01-05
猜你喜欢
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
  • 2021-10-20
  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案