[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);
  StringBuilder sb = new StringBuilder();
GetClassName(hMainWnd, sb,sb.Capacity);//WindowsForms10.STATIC.app.0.3598b65_r16_ad1 来截取后面系统编译生成的后缀
 string suffix = string.IsNullOrEmpty(sb.ToString()) ? "" : sb.ToString().Replace("WindowsForms10.Window.8.app","");//之后按 已确定窗口类+后缀 查找

C# user32.dll找窗口时,使用GetClass方法解决 【带有系统自动编译的窗体类后缀名】 问题的更多相关文章

  1. C# user32.dll 找窗口 填数据

    工具:SpyLite [DllImport("user32.dll", EntryPoint = "FindWindow")] private extern s ...

  2. c# p/invoke 无法加载指定的dll 找不到指定的模块 解决方法

    写的程序本来开始好好的,不知道怎么突然就出现了以上这个问题,纠结了好久,网上找了各种方法,比如什么嵌入dll,在system32下面放入dll等等,均宣告失败 下面把我的解决方法写出来,以后只要是这个 ...

  3. Unable to load DLL 'api-ms-win-core-localization-l1-2-0.dll': 找不到指定的模块

    asp.net mvc 4.6 发布到WinServer2008R2 SP1 提示 错误 Unable to load DLL 'api-ms-win-core-localization-l1-2-0 ...

  4. 调用user32.dll显示其他窗口

    /// 该函数设置由不同线程产生的窗口的显示状态 /// </summary> /// <param name="hWnd">窗口句柄</param& ...

  5. C#中可直接调用WIN32的API函数--USER32.DLL

    Win32的API函数可以直接在C#中直接调用,在做WinForm时还是很有帮助的.有时候直接调用Win32的API,可以很高效的实现想要的效果. using System; using System ...

  6. Winform API "user32.dll"中的函数

    命名空间:System.Runtime.InteropServices /// <summary> /// 该函数检索一指定窗口的客户区域或整个屏幕的显示设备上下文环境的句柄,以后可以在G ...

  7. 【转】c# 调用windows API(user32.dll)

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.R ...

  8. user32.dll

    user32.dll中的所有函数 using System; using System.Collections.Generic; using System.Linq; using System.Tex ...

  9. 【WinAPI】User32.dll注释

    #region User32.dll 函数 /// <summary> /// 该函数检索一指定窗口的客户区域或整个屏幕的显示设备上下文环境的句柄,以后可以在GDI函数中使用该句柄来在设备 ...

随机推荐

  1. Linux学习--第十天--bash脚本、用户自定义变量、环境变量、位置参数变量、预定义变量、标准输入输出、wc、history、dd、PS1

    shell简介 分为两种c shell 和b shell b shell:sh.ksh.Bash.psh.zsh: (Bash和sh兼容,linux基本shell是Bash) c shell:csh. ...

  2. java 集合之HashMap、Hashtable、LinkedHashMap、TreeMap

    HashMap 实现了Map接口,线程不安全. 实现原理: HashMap由数组+链表组成,数组是HashMap的主体,链表则是主要为了解决哈希冲突而存在的. 如果通过hash定位到数组位置没有链表, ...

  3. element-ui + redis + mongo + nuxt

    用户注册: let {username,password} = req.body; let u = await UserModel.findOne({username}); if(u){ res.js ...

  4. oracle 创建表的规则

    1.表明首字母 应该为字母 2.表名的最大长度为30个字符 3.不能使用oracle保留字和关键字来作表名 4.同一用户下的不同表不能具有相同的名称 5.可以使用下划线.数字和字母,但不能使用空格与单 ...

  5. git提示Please enter a commit message to explain why this merge is necessary

    Please enter a commit message to explain why this merge is necessary. 请输入提交消息来解释为什么这种合并是必要的(提交信息) gi ...

  6. 机器学习降维--SVD奇异值分解

    奇异值分解是有着很明显的物理意义,将一个比较复杂的矩阵用更小更简单的几个子矩阵的相乘来表示,这些小矩阵描述的是矩阵的重要的特性,让机器学会抽取重要的特征,SVD是一个重要的方法. 所以SVD不仅是一个 ...

  7. 【Spring】Spring-Session-Data-Redis实现session共享

    前言 在开发中遇到一个关于用户体验的问题,每次当运维进行更新重启服务器时,都会导致会员平台中已登录的用户掉线.这是因为每个用户的会话信息及状态都是由session来保存的,而session对象是由服务 ...

  8. 树莓派VI命令大全(附vim使用异常,卸载重新安装步骤)

    vi有3个模式:插入模式.命令模式.低行模式. 插入模式:在此模式下可以输入字符,按ESC将回到命令模式. 命令模式:可以移动光标.删除字符等. 低行模式:可以保存文件.退出vi.设置vi.查找等功能 ...

  9. 【leetcode】1218. Longest Arithmetic Subsequence of Given Difference

    题目如下: Given an integer array arr and an integer difference, return the length of the longest subsequ ...

  10. 部署zabbix 4.0 + grafana

    不完整,仅供参考 Zabbix+grafana监控部署 基本环境 系统: CentOS Linux release 7.3.1611 Zabbix—server:  Zabbix_agent:   N ...