当前位置:网站首页>C# 调用SendMessage刷新任务栏图标(强制结束时图标未消失)
C# 调用SendMessage刷新任务栏图标(强制结束时图标未消失)
2020-11-06 21:24:00 【程序猿欧文】
本文参考C++改写 https://blog.csdn.net/dpsying/article/details/20139651 (该文章的坐标理解的有误解,会导致功能无效)
SendMessage的移动鼠标里的坐标 是基于句柄内的 坐标,并不是屏幕坐标,任务栏宽度300 高度固定40,那么就应该从宽度0-300 坐标15之间 移动过去。
首先声明需要用到的 winapi 函数
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
封装调用的流程方法
版权声明
本文为[程序猿欧文]所创,转载请带上原文链接,感谢
https://my.oschina.net/mikeowen/blog/4556921
边栏推荐
- Unity性能优化整理
- NLP model Bert: from introduction to mastery (1)
- Elasticsearch数据库 | Elasticsearch-7.5.0应用搭建实战
- Humor: hacker programming is actually similar to machine learning!
- ES6学习笔记(二):教你玩转类的继承和类的对象
- Cglib 如何实现多重代理?
- python100例項
- Interface pressure test: installation, use and instruction of siege pressure test
- 【ElasticSearch搜索引擎】
- 零基础打造一款属于自己的网页搜索引擎
猜你喜欢

Word segmentation, naming subject recognition, part of speech and grammatical analysis in natural language processing

一路踩坑,被迫聊聊 C# 代码调试技巧和远程调试

零基础打造一款属于自己的网页搜索引擎

一篇文章教会你使用Python网络爬虫下载酷狗音乐

Live broadcast preview | micro service architecture Learning Series live broadcast phase 3

Free patent download tutorial (HowNet, Espacenet)

How to use Python 2.7 after installing anaconda3?

Using NLP and ml to extract and construct web data

Three Python tips for reading, creating and running multiple files

Discussion on the technical scheme of text de duplication (1)
随机推荐
html+vue.js 實現分頁可相容IE
Installing ns-3 on ubuntu18.04
Python filtering sensitive word records
Lane change detection
What are manufacturing and new automation technologies?
Electron application uses electronic builder and electronic updater to realize automatic update
Vue.js Mobile end left slide delete component
一篇文章带你了解CSS3 背景知识
Our best practices for writing react components
[efficiency optimization] Nani? Memory overflow again?! It's time to sum up the wave!!
游戏主题音乐对游戏的作用
What to do if you are squeezed by old programmers? I don't want to quit
NLP model Bert: from introduction to mastery (1)
Discussion on the development practice of aspnetcore, a cross platform framework
How to understand Python iterators and generators?
Introduction to X Window System
Simple summary of front end modularization
ES6学习笔记(二):教你玩转类的继承和类的对象
Shh! Is this really good for asynchronous events?
Building and visualizing decision tree with Python