当前位置:网站首页>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
边栏推荐
- 这个项目可以让你在几分钟快速了解某个编程语言
- NLP model Bert: from introduction to mastery (1)
- 一篇文章带你了解HTML表格及其主要属性介绍
- html+vue.js 實現分頁可相容IE
- Python基础数据类型——tuple浅析
- Solve the problem of database insert data garbled in PL / SQL developer
- Natural language processing - BM25 commonly used in search
- With the advent of tensorflow 2.0, can pytoch still shake the status of big brother?
- 一篇文章教会你使用HTML5 SVG 标签
- The difference between gbdt and XGB, and the mathematical derivation of gradient descent method and Newton method
猜你喜欢
The importance of big data application is reflected in all aspects
DRF JWT authentication module and self customization
Mac installation hanlp, and win installation and use
仅用六种字符来完成Hello World,你能做到吗?
Read the advantages of Wi Fi 6 over Wi Fi 5 in 3 minutes
Python基础变量类型——List浅析
Wow, elasticsearch multi field weight sorting can play like this
代码生成器插件与Creator预制体文件解析
What are the common problems of DTU connection
Cglib 如何实现多重代理?
随机推荐
Asp.Net Core learning notes: Introduction
用一个例子理解JS函数的底层处理机制
Python Jieba segmentation (stuttering segmentation), extracting words, loading words, modifying word frequency, defining thesaurus
Simple summary of front end modularization
For a while, a dynamic thread pool was created, and the source code was put into GitHub
(1) ASP.NET Introduction to core3.1 Ocelot
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
Introduction to the structure of PDF417 bar code system
消息队列(MessageQueue)-分析
Word segmentation, naming subject recognition, part of speech and grammatical analysis in natural language processing
Mac installation hanlp, and win installation and use
C語言I部落格作業03
Wow, elasticsearch multi field weight sorting can play like this
Analysis of query intention recognition
一篇文章教会你使用HTML5 SVG 标签
What course of artificial intelligence? Will it replace human work?
Natural language processing - BM25 commonly used in search
Who says cat can't do link tracking? Stand up for me
Network programming NiO: Bio and NiO
Shh! Is this really good for asynchronous events?