当前位置:网站首页>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
边栏推荐
- How to get started with new HTML5 (2)
- Installing ns-3 on ubuntu18.04
- Basic usage of GDB debugging
- 使用 Iceberg on Kubernetes 打造新一代雲原生資料湖
- JVM内存分配 -Xms128m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=512m
- Jmeter——ForEach Controller&Loop Controller
- 一部完整的游戏,需要制作哪些音乐?
- 新建一个空文件占用多少磁盘空间?
- Individual annual work summary and 2019 work plan (Internet)
- 一路踩坑,被迫聊聊 C# 代码调试技巧和远程调试
猜你喜欢
【:: 是什么语法?】
Python filtering sensitive word records
零基础打造一款属于自己的网页搜索引擎
Building and visualizing decision tree with Python
The AI method put forward by China has more and more influence. Tianda et al. Mined the development law of AI from a large number of literatures
一路踩坑,被迫聊聊 C# 代码调试技巧和远程调试
Individual annual work summary and 2019 work plan (Internet)
C + + and C + + programmers are about to be eliminated from the market
Natural language processing - BM25 commonly used in search
The importance of big data application is reflected in all aspects
随机推荐
A course on word embedding
How to use parameters in ES6
Read the advantages of Wi Fi 6 over Wi Fi 5 in 3 minutes
消息队列(MessageQueue)-分析
Multi classification of unbalanced text using AWS sagemaker blazingtext
What course of artificial intelligence? Will it replace human work?
The difference between gbdt and XGB, and the mathematical derivation of gradient descent method and Newton method
Free patent download tutorial (HowNet, Espacenet)
Natural language processing - wrong word recognition (based on Python) kenlm, pycorrector
【應用程式見解 Application Insights】Application Insights 使用 Application Maps 構建請求鏈路檢視
The road of C + + Learning: from introduction to mastery
Solve the problem of database insert data garbled in PL / SQL developer
C語言I部落格作業03
[efficiency optimization] Nani? Memory overflow again?! It's time to sum up the wave!!
(1) ASP.NET Introduction to core3.1 Ocelot
一篇文章教会你使用Python网络爬虫下载酷狗音乐
Humor: hacker programming is actually similar to machine learning!
Custom function form of pychar shortcut key
It is really necessary to build a distributed ID generation service
Recommendation system based on deep learning