首页 > 其他分享 >在Alt+Tab中使窗口不可见

在Alt+Tab中使窗口不可见

时间:2023-10-20 17:24:35浏览次数:38  
标签:窗口 int hwnd private WS Tab GWL Alt 中使

#region 在Alt+Tab中使窗口不可见
        // 定义用于修改窗口样式的常量
        private const int GWL_EXSTYLE = -20;
        private const int WS_EX_TOOLWINDOW = 0x00000080;

        // 导入 Windows API 函数
        [DllImport("user32.dll")]
        private static extern int GetWindowLong(IntPtr hwnd, int index);

        [DllImport("user32.dll")]
        private static extern int SetWindowLong(IntPtr hwnd, int index, int newStyle);
        #endregion

使用

            WindowInteropHelper wndHelper = new WindowInteropHelper(this);
            IntPtr hwnd = wndHelper.Handle;

            // 获取当前窗口样式
            int currentStyle = GetWindowLong(hwnd, GWL_EXSTYLE);

            // 设置 WS_EX_TOOLWINDOW 样式,这会使窗口在任务切换时不可见
            SetWindowLong(hwnd, GWL_EXSTYLE, currentStyle | WS_EX_TOOLWINDOW);

 

标签:窗口,int,hwnd,private,WS,Tab,GWL,Alt,中使
From: https://www.cnblogs.com/wangjintao99/p/17777560.html

相关文章

  • 视频直播app源码,去掉导航条和tabbar线条
    视频直播app源码,去掉导航条和tabbar线条去掉导航条底部线条 [self.navigationController.navigationBarsetBackgroundImage:[[UIImagealloc]init]forBarMetrics:UIBarMetricsDefault];  [self.navigationController.navigationBarsetShadowImage:[[UIImagealloc]in......
  • centos多版本jdk通过alternatives
    一、下载Linux版的JDK到本地本文以jdk-8u341-linux-x64.tar.gz、jdk-11.0.16_linux-x64_bin.tar.gz为例。二、创建Java目录安装  1.mkdir/usr/java/2.解压JDK到Java目录tar-zxvfjdk-8u341-linux-x64.tar.gz-C/usr/java/tar-zxvfjdk-11.0.1......
  • 什么是 nftables ? 它与 iptables 的区别是什么?
    与iptables相比,nftables的语法更加简单,不过对于iptables中的语法,在nftables中也能用。大家可使用iptables-translate工具,该工具接受iptables命令并将其转为等效的nftables命令,这是了解两种语法差异的一种简单方法。使用以下命令在Ubuntu和基于Debian的发行版上......
  • [920] Copy the font style from one cell in a table of a Word document to another
    TocopythefontstylefromonecellinatableofaWorddocumenttoanothercellusingPythonandthepython-docxlibrary,youcanaccessthefontpropertiesofthesourcecellandapplythemtothetargetcell.Here'showyoucandoit:First,ma......
  • 错误:You can't specify target table 'xxx' for update in FROM clause的解决
    deleteFROMusrloginwheremember_id=(SELECTmember_idFROMusrloginWHERElogin_id='#011SkhVVje27smbxek0XwjKeA==');会出现报错信息:Youcan'tspecifytargettable'tempA'forupdateinFROMclause大致意思是,在同一语句中,不能先select出同一表中的......
  • Codeforces Round 872 (Div. 2) B. LuoTianyi and the Table
    给一个\(n\timesm\)的矩阵和\(n\timesm\)个数,你需要把这些数填入矩阵。保证\[\sum_{i=1}^n\sum_{j=1}^m\left(\mathop{max}\limits_{1\leqx\leqi,1\leqy\leqj}a_{x,y}-\mathop{min}\limits_{1\leqx\leqi,1\leqy\leqj}a_{x,y}\right)......
  • 容器环境中安装salt-master salt-api
    FROMcentos:7RUNcurl-fsSLhttps://repo.saltproject.io/py3/redhat/7/x86_64/3004.repo|tee/etc/yum.repos.d/salt.repo&&\sed-i"s/repo.saltproject.com/mirrors.aliyun.com\/saltstack/g"/etc/yum.repos.d/salt.repo&&\......
  • celery包结构、celery延迟任务和定时任务、django中使用celery、接口缓存、双写一致性
    celery包结构project├──celery_task #celery包  这个包可以放在任意位置│├──__init__.py#包文件│├──celery.py#celery连接和配置相关文件,且名字必须叫celery.py│└──tasks.py#所有任务函数│├──add_task.p......
  • iptables常用命令
    iptables是用于配置Linux系统中的防火墙规则的命令行工具。其命令格式和常用参数的意思如下:iptables[选项]<链名><规则规范>常用选项:-A:添加规则到指定链的末尾。-D:从指定链中删除规则。-I:插入规则到指定链的开头。-L:列出指定链的规则。-F:清除指定链中的所有规则。-P:......
  • ASP.NET 定时发送邮件以及将数据库的数据以table形式发送
    1:代码写在Global.aszx中,系统自动运行 2:对Send()方法进行编辑,设定发送的时间、发送邮箱和接收邮箱publicvoidSend(objectsender,System.Timers.ElapsedEventArgse){SqlConnectionmyconn=newSqlConnection("DataSource=100.0.4.51;InitialC......