zoukankan      html  css  js  c++  java
  • GetCursorPos

     



    获取桌面坐标



    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Runtime.InteropServices;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    namespace WindowsFormsApplication1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }

            #region
         
            [DllImport("user32.dll", CharSet = CharSet.Auto)]
            public static extern bool GetCursorPos(out POINT pt);
            [StructLayout(LayoutKind.Sequential)]
            public struct POINT
            {
                public int X;
                public int Y;
                public POINT(int x, int y)
                {
                    this.X = x;
                    this.Y = y;
                }
            }
            #endregion

            private void timer1_Tick(object sender, EventArgs e)
            {
                POINT pt = new POINT();
                GetCursorPos(out pt);
                textBox1.Text = string.Format("{0},{1}", pt.X,pt.Y);
            }
        }
    }





    附件列表

    • 相关阅读:
      luogu 1865 数论 线性素数筛法
      洛谷 2921 记忆化搜索 tarjan 基环外向树
      洛谷 1052 dp 状态压缩
      洛谷 1156 dp
      洛谷 1063 dp 区间dp
      洛谷 2409 dp 月赛题目
      洛谷1199 简单博弈 贪心
      洛谷1417 烹调方案 dp 贪心
      洛谷1387 二维dp 不是特别简略的题解 智商题
      2016 10 28考试 dp 乱搞 树状数组
    • 原文地址:https://www.cnblogs.com/xe2011/p/6094532.html
    Copyright © 2011-2022 走看看