我在C#中使用“覆盖”游戏的简单方法,这种方法有效,但我希望得到窗口(X,Y)的“中心”和我得到的Graphics对象。 (不是基于Screen res?)我试过在MSDN上寻找一种方法,但找不到办法。
String UserGameWindow = TextBox1.Text;
IntPtr gameWindow = FindWindow(null, UserGameWindow); //"GameWindow" is replaced by the window the user selects.
using (Graphics g = Graphics.FromHwnd(gameWindow))
{
//Getting the "center" of the window (X,Y) from the Graphics object not dependent on screen resolution?
}