jy8888

  前段时间想在上班时候偷偷看点什么,在网上找了很久都找不到一键隐藏或者老板键的软件。(下载下来要不就是带广告,要不就是捆绑,还有就是病毒软件)一不做二不休,还是自己开发吧,靠自己。

首先一键隐藏需要调用windows的函数,所以引入需要用到的函数。

下面是隐藏显示用的函数

     /// <summary>
        /// 隐藏显示用
        /// </summary>
        /// <param name="hWnd"></param>
        /// <param name="nCmdShow"></param>
        /// <returns></returns>
        [DllImport("user32.dll", EntryPoint = "ShowWindow", SetLastError = true)]
        private static extern bool ShowWindow(IntPtr hWnd, uint nCmdShow);

下面是窗口置顶用的函数

        /// <summary>
        /// 窗口置顶
        /// </summary>
        /// <param name="hWnd"></param>
        /// <param name="hWndInsertAfter"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="Width"></param>
        /// <param name="Height"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        [DllImport("user32.dll", CharSet = CharSet.Auto)]
        private static extern int SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int y, int Width, int Height, int flags);   

接下来就是注册老板键

  HotKey.RegisterHotKey(Handle, 100, HotKey.KeyModifiers.Alt, Keys.S);

软件主要是需要获取任务的句柄,然后有了句柄就可以操作一件隐藏啦!!!!

 

相关文章:

  • 2021-05-30
  • 2022-12-23
  • 2022-12-23
  • 2021-03-31
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
猜你喜欢
  • 2021-09-08
  • 2021-09-08
  • 2021-09-08
  • 2021-09-08
  • 2022-12-23
  • 2021-12-12
相关资源
相似解决方案