当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- All the way, I was forced to talk about C code debugging skills and remote debugging
- Small program introduction to proficient (2): understand the four important files of small program development
- To teach you to easily understand the basic usage of Vue codemirror: mainly to achieve code editing, verification prompt, code formatting
- What is alicloud's experience of sweeping goods for 100 yuan?
- ES6 learning notes (2): teach you to play with class inheritance and class objects
- Pn8162 20W PD fast charging chip, PD fast charging charger scheme
- ES6 learning notes (4): easy to understand the new grammar of ES6
- Python 100 cases
- Outsourcing is really difficult. As an outsourcer, I can't help sighing.
- An article takes you to understand CSS3 picture border
猜你喜欢
行为型模式之解释器模式
非易失性MRAM存储器应用于各级高速缓存
Digital city responds to relevant national policies and vigorously develops the construction of digital twin platform
An article will introduce you to HTML tables and their main attributes
小熊派开发板实践:智慧路灯沙箱实验之真实设备接入
Summary of front-end performance optimization that every front-end engineer should understand:
Elasticsearch database | elasticsearch-7.5.0 application construction
Git rebase is in trouble. What to do? Waiting line
面试官: ShardingSphere 学一下吧
Using an example to understand the underlying processing mechanism of JS function
随机推荐
细数软件工程----各阶段必不可少的那些图
谷歌浏览器实现视频播放加速功能
2020-08-20:GO语言中的协程与Python中的协程的区别?
Filecoin has completed a major upgrade and achieved four major project progress!
ES6 learning notes (5): easy to understand ES6's built-in extension objects
2020-09-09:裸写算法:两个线程轮流打印数字1-100。
What kind of music do you need to make for a complete game?
Why is the LS command stuck when there are too many files?
Description of phpshe SMS plug-in
Multi robot market share solution
2020年第四届中国 BIM (数字建造)经理高峰论坛即将在杭举办
window系统 本机查找端口号占用方法
To Lianyun analysis: why is IPFs / filecoin mining so difficult?
With this artifact, quickly say goodbye to spam messages
[elastic search engine]
Hdu3974 assign the task segment tree DFS order
ES6 learning notes (4): easy to understand the new grammar of ES6
【学习】接口测试用例编写和测试关注点
Python basic data type -- tuple analysis
From overseas to China, rancher wants to do research on container cloud market