当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
猜你喜欢
2020-08-17:详细说下数据倾斜怎么解决?
Use modelarts quickly, zero base white can also play AI!
非易失性MRAM存储器应用于各级高速缓存
Why is the LS command stuck when there are too many files?
Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
2020-08-19:TCP是通过什么机制保障可靠性的?
Building a new generation cloud native data lake with iceberg on kubernetes
This project allows you to quickly learn about a programming language in a few minutes
实用工具类函数(持续更新)
ado.net和asp.net的关系
随机推荐
An article taught you to download cool dog music using Python web crawler
Swagger 3.0 brushes the screen every day. Does it really smell good?
面试官: ShardingSphere 学一下吧
Take you to learn the new methods in Es5
[self taught unity2d legendary game development] map editor
大会倒计时|2020 PostgreSQL亚洲大会-中文分论坛议程安排
What the hell is fastthreadlocal? The existence of ThreadLocal!!
Vue communication and cross component listening state Vue communication
This project allows you to quickly learn about a programming language in a few minutes
Use modelarts quickly, zero base white can also play AI!
代码重构之法——方法重构分析
Message queue - Analysis
Pn8162 20W PD fast charging chip, PD fast charging charger scheme
ERD-ONLINE 免费在线数据库建模工具
检测证书过期脚本
What grammar is it? ]
Contract trading system development | construction of smart contract trading platform
An article will take you to understand SVG gradient knowledge
How about small and medium-sized enterprises choose shared office?
2020-08-19:TCP是通过什么机制保障可靠性的?