Ejemplo n.º 1
0
 public void Initial()
 {
     hwnd = dm.FindWindow("King GEngine", null);
     if (hwnd != 0)
     {
         if (dm.BindWindow(hwnd, "normal", "normal", "normal", 0) == 0)
         {
             MessageBox.Show("绑定窗口错误, 错误代码为: " + dm.GetLastError());
         }
         else
         {
             if (dm.SetWindowState(hwnd, 8) == 0)
             {
                 MessageBox.Show("游戏置顶失败, 错误代码为: " + dm.GetLastError());
             }
             else
             {
                 if (dm.MoveWindow(hwnd, -8, -31) == 0)
                 {
                     MessageBox.Show("游戏重置位置失败, 错误代码为: " + dm.GetLastError());
                 }
             }
         }
     }
     else
     {
         MessageBox.Show("无法找到游戏窗口, 错误代码为: " + dm.GetLastError());
     }
 }