当前位置:网站首页>C calls SendMessage to refresh the taskbar icon (the icon does not disappear at the end of forcing)
C calls SendMessage to refresh the taskbar icon (the icon does not disappear at the end of forcing)
2020-11-06 21:24:00 【Irving the procedural ape】
In this paper, the reference C++ rewrite https://blog.csdn.net/dpsying/article/details/20139651 ( There are misunderstandings about the coordinates of this article , It will lead to invalid function )
SendMessage Move the coordinates in the mouse It's based on the inside of the handle coordinate , It's not screen coordinates , Taskbar width 300 Fixed height 40, So it should be from the width 0-300 coordinate 15 Between Move past .
First state what you need to use winapi function


1 [DllImport("user32.dll", EntryPoint = "FindWindow")] 2 private static extern int FindWindow(string lpszClass, string lpszWindow); 3 [DllImport("user32.dll", EntryPoint = "FindWindowEx")] 4 private static extern int FindWindowEx(int hwndParent, int hwndChildAfter, string lpszClass, string lpszWindow); 5 6 [DllImport("user32.dll", EntryPoint = "GetWindowRect")] 7 private static extern int GetWindowRect(int hwnd, ref System.Drawing.Rectangle lpRect); 8 [DllImport("user32.dll", EntryPoint = "SendMessage")] 9 private static extern int SendMessage(int hwnd, int wMsg, int wParam, int lParam);10 11 private static readonly int WM_MOUSEMOVE = 512;
winapi
Encapsulate the called process method
版权声明
本文为[Irving the procedural ape]所创,转载请带上原文链接,感谢
边栏推荐
- Will blockchain be the antidote to the global epidemic accelerating the transformation of Internet enterprises?
- 2020-08-18:介绍下MR过程?
- 面试官: ShardingSphere 学一下吧
- Those who have worked in China for six years and a million annual salary want to share these four points with you
- 解决 WPF 绑定集合后数据变动界面却不更新的问题
- Junit测试出现 empty test suite
- Unity performance optimization
- Using iceberg on kubernetes to create a new generation of cloud original data Lake
- What are the highlights of Huawei mate 40 series with HMS?
- [elastic search engine]
猜你喜欢
Flink's datasource Trilogy 2: built in connector
How does cglib implement multiple agents?
jenkins安装部署过程简记
2020-08-15:什么情况下数据任务需要优化?
An article taught you to use HTML5 SVG tags
mongo 用户权限 登录指令
小熊派开发板实践:智慧路灯沙箱实验之真实设备接入
An article will take you to understand CSS3 fillet knowledge
2020-08-19:TCP是通过什么机制保障可靠性的?
嘉宾专访|2020 PostgreSQL亚洲大会阿里云数据库专场:曾文旌
随机推荐
Flink's datasource Trilogy 2: built in connector
Stickinengine architecture 11 message queue
An article will introduce you to HTML tables and their main attributes
Open source a set of minimalist front and rear end separation project scaffold
(2) ASP.NET Core3.1 Ocelot routing
Helping financial technology innovation and development, atfx is at the forefront of the industry
How much disk space does a new empty file take?
Those who have worked in China for six years and a million annual salary want to share these four points with you
2020-08-15:什么情况下数据任务需要优化?
Zero basis to build a web search engine of its own
2020-08-29:进程线程的区别,除了包含关系之外的一些区别,底层详细信息?
2020-08-30:裸写算法:二叉树两个节点的最近公共祖先。
Use modelarts quickly, zero base white can also play AI!
In depth to uncover the bottom layer of garbage collection, this time let you understand her thoroughly
Summary of front-end interview questions (C, s, s) that front-end engineers need to understand (2)
Digital city responds to relevant national policies and vigorously develops the construction of digital twin platform
Tron smart wallet PHP development kit [zero TRX collection]
What the hell is fastthreadlocal? The existence of ThreadLocal!!
An article will take you to understand CSS alignment
2020-08-24:什么是小文件?很多小文件会有什么问题?很多小文件怎么解决?(大数据)