-
获得焦点的窗口和窗口的句柄
应用背景通过使用这个应用程序,您可以轻松地获得标题和当前焦点的窗口句柄的句柄。在这个项目中我们必须使函数调用user32.dll是Windows的API的一部分。两种功能,我们将使用:getforegroundwindow() -得到处理和了解处理我们可以称getwindowtext()获得窗口的标题。关键技术在我们进入代码之前,让我们先添加2个标签,2个文本框和一个计时器。相应地将所有这些名称命名,设置定时器的时间间隔,当然,允许它。现在的代码。首先,我们定义我们的使用报表:使用系统;使用系统;使用system.windows.forms;使用system.runtime.interopservices;我们需要一个命名空间,所以我们可以使用dllimport。然后我们宣布我们的Windows API函数使用dllimport: ; ; ; ; ; ; ;[ dllimport(“user32。dll”)]静态extern int getforegroundwindow();【dllimport(“user32。dll”)]静态extern int GetWindowText(int HWND,StringBuilder文本,int数);最后,我们插入下面的代码,在计时器的滴答声(双按您的定时器在设计视图)事件: ; ; ; ; ; ; ; ; ; ; ; ;const int CHR = 256; ; ; ; ; ; ; ; ; ; ; ;int处理= 0; ; ; ; ; ; ; ; ; ; ; ;StringBuilder缓冲=新的StringBuilder(CHR); ; ; ; ; ; ; ; ; ; ; ;getforegroundwindow()处理=;&n
- 2023-04-09 00:00:03下载
- 积分:1
-
- 2022-06-12 01:53:23下载
- 积分:1
-
这是一个关于粒子群算法的程序源码,已经在C++6.0运行过了,真的是不错的一个程序...
这是一个关于粒子群算法的程序源码,已经在C++6.0运行过了,真的是不错的一个程序-This is a process on the particle swarm algorithm source code, has been run over C++6.0, and really is a good a program
- 2023-08-05 04:00:04下载
- 积分:1
-
浮点型转换成字符型的小程序,用任何显示器都能显示
浮点型转换成字符型的小程序,用任何显示器都能显示-Converted to floating-point type of the small character procedures, any display can show
- 2022-01-28 14:29:48下载
- 积分:1
-
some project that tracking the budget system
some project that tracking the budget system
- 2022-09-14 20:25:03下载
- 积分:1
-
NXP
NXP
8-bit synchronous binary down
counter
- 2022-01-25 20:23:43下载
- 积分:1
-
用于哈夫曼的压缩程序,可以对图象处理
用于哈夫曼的压缩程序,可以对图象处理-for Huffman compression process to image processing. .
- 2022-01-25 20:28:42下载
- 积分:1
-
在qt编程环境下,把一个数据库直接读到工作表里的源码.
在qt编程环境下,把一个数据库直接读到工作表里的源码.-Qt programming in the environment, to directly read the work of a database table of the source.
- 2022-02-05 22:49:43下载
- 积分:1
-
内存漏洞测试,在windows环境下,测试动态创建对象的内存耗费情况!...
内存漏洞测试,在windows环境下,测试动态创建对象的内存耗费情况!-memory test loopholes in windows environment, the testing of dynamic object creation cost of memory!
- 2022-05-23 13:54:52下载
- 积分:1
-
java版简易贪吃蛇
eclipse所编写的简易版贪吃蛇,简单易理解,用list存储,有计分,蟹蟹!!!
- 2022-08-20 11:50:12下载
- 积分:1